My, oh my, now I've got menus in windows, and menus by popups! Amazing what an example will do. Thanks. Now I have to populate their _Click routines!
"Piske, Harald" wrote: > Note: I took the liberty of changing the subject, since this is not about > BringWindowToTop anymore. > > About the popup menu, see trail "Re; Popup menu", posting by Jonathan > Southwick on April 2nd, 2001. Apparently, Ludvig af Klinteberg subsequently > managed to use the code for a tray icon. > Quote: > > # define popup menu for listview > my $PopupMenu = new Win32::GUI::Menu( > "Item Properties" => "ItemProp", > ">&Properties" => "ItemProperties", > ); > > # get right-click in listview > sub DataView_RightClick { > my($X, $Y) = Win32::GUI::GetCursorPos(); > > $MainWindow->TrackPopupMenu($PopupMenu->{ItemProp},$X, $Y); > } > > # clicked on particular menu item in popup menu > sub ItemProperties_Click { > ## code you want to process; > } > > Thanks, Jonathan > Have fun > Harald > > > -----Original Message----- > > From: Glenn Linderman [mailto:[EMAIL PROTECTED] > > Sent: Donnerstag, 7. Juni 2001 17:33 > > To: perl-win32-gui-users@lists.sourceforge.net > > Subject: Re: [perl-win32-gui-users] BringWindowToTop doesn't > > > > > > Does anyone have sample code to create a pop-up menu for a > > Notify Icon's > > right click? That seems to be the current rage for System > > Tray icons? I've > > got a few other enhancements to make, and then I'll be looking that > > direction. > > > > I'm speculating that on click detection, you'd position and > > show a window > > that contains nothing but a menu item... but there's a lot of > > details to > > address to get that right, if it can even be done. > > > > Peter Eisengrein wrote: > > > > > I've used SetForegroundWindow() from a NotifyIcon and that > > works on NT4. > > > > > > sub ni_Click > > > { > > > if ($Window->IsVisible) > > > { > > > $Window->Hide(); > > > } > > > else > > > { > > > $Window->Show(); > > > $Window->SetForegroundWindow(); > > > } > > > > > > return 0; > > > } > > > > > > > -----Original Message----- > > > > From: Piske, Harald [mailto:[EMAIL PROTECTED] > > > > Sent: Wednesday, June 06, 2001 10:12 PM > > > > To: 'perl-win32-gui-users@lists.sourceforge.net' > > > > Subject: RE: [perl-win32-gui-users] BringWindowToTop doesn't > > > > > > > > > > > > Works with me ... I have two windows, one button in the first > > > > window brings > > > > the other to top. Complete code snippet attached for you to > > > > check if it > > > > works with you and figure out the differences to yours. > > Oh, and I only > > > > checked on Win2k. > > > > > > > > Have fun, > > > > Harald > > > > > > > > > -----Original Message----- > > > > > From: Glenn Linderman [mailto:[EMAIL PROTECTED] > > > > > Sent: Mittwoch, 6. Juni 2001 18:25 > > > > > To: Win32::GUI > > > > > Subject: [perl-win32-gui-users] BringWindowToTop doesn't > > > > > > > > > > > > > > > Hi, > > > > > > > > > > So I've got this code, and it doesn't bring the window to > > > > the top. I > > > > > can see that each time I click on the notify icon that > > the code gets > > > > > executed, both because the print statement fires, and the window > > > > > redraws. But the window stays behind other windows, in > > spite of the > > > > > BringWindowToTop call. It does that with or without > > the Hide/Show > > > > > sequence, and with or with a Disable/Enable sequence wrapped > > > > > around the > > > > > BringWindowToTop. ActivePerl 5.6.1 build 626, Win32::GUI > > > > > 0.0.558. What > > > > > trick am I missing? > > > > > > > > > > I'm quite willing to throw all this away, and use whatever > > > > > works... this > > > > > is just what sounded like should work from the documentation. > > > > > > > > > > I should note that $mw is using the "parent window" trick to > > > > > avoid being > > > > > on the task bar. I further note that sufficient Alt-Tab > > > > keystrokes do > > > > > eventually raise the window to the top. > > > > > > > > > > sub notify_icon_Click > > > > > { if ( $mw -> IsVisible ()) > > > > > { print "Bring Main to Top\n"; > > > > > $mw -> Hide (); > > > > > $mw -> BringWindowToTop (); > > > > > $mw -> Show (); > > > > > } > > > > > } > > > > > > > > > > -- > > > > > Glenn > > > > > ===== > > > > > Due to the current economic situation, the light at the > > > > > end of the tunnel will be turned off until further notice. > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Perl-Win32-GUI-Users mailing list > > > > > Perl-Win32-GUI-Users@lists.sourceforge.net > > > > > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Perl-Win32-GUI-Users mailing list > > > Perl-Win32-GUI-Users@lists.sourceforge.net > > > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > > -- > > Glenn > > ===== > > Due to the current economic situation, the light at the > > end of the tunnel will be turned off until further notice. > > > > > > > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Perl-Win32-GUI-Users@lists.sourceforge.net > > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Perl-Win32-GUI-Users@lists.sourceforge.net > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users -- Glenn ===== Due to the current economic situation, the light at the end of the tunnel will be turned off until further notice.