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 <[EMAIL PROTECTED]>
To: <perl-win32-gui-users@lists.sourceforge.net>
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 {
|        &note("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 {
|
|        &note("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
| Perl-Win32-GUI-Users@lists.sourceforge.net
| http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
|


Reply via email to