From: Morbus I. <mo...@di...> - 2001-06-15 15:55:50
|
Has anyone noticed Systray clicks being sent twice to the script. For example, below is a code snippet. Whenever anyone clicks on "Open Window" for instance, the subroutine is called twice. We've had to implement a workaround (further below). # Create the popup menu $systray_menu = new Win32::GUI::Menu( "SystrayMenu Functions" => "SystrayMenu", "> Open Window" => "_OpenWindow", "> Refresh Channels" => "_RefreshChannels", "> Exit" => "_FileExit" ); # re-open the browser window. sub _OpenWindow_Click { ¬e("Received 'Open Window' request from Systray."); &open_url( $SETTINGS->{urls}->{channels_home} ); } The work around is rather simple, of course: # re-open the browser window. sub _OpenWindow_Click { ¬e("Received 'Open Window' request from Systray."); unless ( $already_called ) { # do the dirty deed. &open_url( $SETTINGS->{urls}->{channels_home} ); # for some reason, we get two clicks every # time someone clicks a menu item. we check # for this here. $already_called = 1; } else { $already_called = 0; } } Morbus Iff .sig on other machine. http://www.disobey.com/ http://www.gamegrene.com/ |
From: Kevin H. <in...@to...> - 2001-06-15 15:51:46
|
Has anyone noticed Systray clicks being sent twice to the script. For example, below is a code snippet. Whenever anyone clicks on "Open Window" for instance, the subroutine is called twice. We've had to implement a workaround (further below). # Create the popup menu $systray_menu = new Win32::GUI::Menu( "SystrayMenu Functions" => "SystrayMenu", "> Open Window" => "_OpenWindow", "> Refresh Channels" => "_RefreshChannels", "> Exit" => "_FileExit" ); # re-open the browser window. sub _OpenWindow_Click { ¬e("Received 'Open Window' request from Systray."); &open_url( $SETTINGS->{urls}->{channels_home} ); } The work around is rather simple, of course: # re-open the browser window. sub _OpenWindow_Click { ¬e("Received 'Open Window' request from Systray."); unless ( $already_called ) { # do the dirty deed. &open_url( $SETTINGS->{urls}->{channels_home} ); # for some reason, we get two clicks every # time someone clicks a menu item. we check # for this here. $already_called = 1; } else { $already_called = 0; } } -- ----------------------------------------------------------------------- Kevin Hemenway |
From: Erick B. <er...@je...> - 2001-06-16 16:43:42
|
These code snippets would be perfect for the Perl Code Exhange. You can find the Code Exchange on my site (jeb.ca). Basically the Code Exchange will be a place where you can find code/binary for Perl ONLY. The Exchange would reduce redundancy on this list, you can now say, "Well, the code for *that*, is located on the Exchange." A brief description can be found here: http://www.jeb.ca/cgi-bin/exchange/display.cgi p.s. I will be adding a search.cgi and upload.cgi, if there is a high demand for it. Please enjoy! regards, erick bourgeois ----- Original Message ----- From: Morbus Iff <mo...@di...> To: <per...@li...> Sent: Friday, June 15, 2001 8:57 AM Subject: [perl-win32-gui-users] Systray Clicks Are Called Twice? | Has anyone noticed Systray clicks being sent twice to the script. For | example, below is a code snippet. Whenever anyone clicks on "Open Window" | for instance, the subroutine is called twice. We've had to implement a | workaround (further below). | | # Create the popup menu | $systray_menu = new Win32::GUI::Menu( | "SystrayMenu Functions" => "SystrayMenu", | "> Open Window" => "_OpenWindow", | "> Refresh Channels" => "_RefreshChannels", | "> Exit" => "_FileExit" | ); | | # re-open the browser window. | sub _OpenWindow_Click { | ¬e("Received 'Open Window' request from Systray."); | &open_url( $SETTINGS->{urls}->{channels_home} ); | } | | The work around is rather simple, of course: | | # re-open the browser window. | sub _OpenWindow_Click { | | ¬e("Received 'Open Window' request from Systray."); | | unless ( $already_called ) { | | # do the dirty deed. | &open_url( $SETTINGS->{urls}->{channels_home} ); | | # for some reason, we get two clicks every | # time someone clicks a menu item. we check | # for this here. | $already_called = 1; | } | | else { $already_called = 0; } | } | | | Morbus Iff | .sig on other machine. | http://www.disobey.com/ | http://www.gamegrene.com/ | | | _______________________________________________ | Perl-Win32-GUI-Users mailing list | Per...@li... | http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users | |