From: Frazier, J. J. <Joe...@Pe...> - 2001-06-13 17:13:23
|
No go.. Got the "Cant Locate object method Change in package Win32::GUI::NotifyIcon ..... Any more thoughts? > -----Original Message----- > From: Piske, Harald [mailto:Har...@bo...] > Sent: Wednesday, June 13, 2001 12:58 > To: 'per...@li...' > Subject: RE: [perl-win32-gui-users] RE: How to change tip for Notify > Icon >=20 >=20 > I did not try this, but when setting a hash value doesn't=20 > work with a GUI > object, Aldo sometimes tells us to use the Change method instead. I.e. >=20 > $Window->NI->Change(-tip =3D> "Show PCKeys"); > instead of > $Window->NI->{-tip} =3D "Show PCKeys"; >=20 > Worth trying. > Have fun, > Harald >=20 > > -----Original Message----- > > From: Frazier, Joe Jr [mailto:Joe...@Pe...] > > Sent: Wednesday, June 13, 2001 08:19 > > To: per...@li... > > Subject: [perl-win32-gui-users] RE: How to change tip for=20 > Notify Icon > >=20 > >=20 > > Below is part of some code. I want to be able to change the=20 > > Notify Icon > > tip based on the status of the main window: > >=20 > > If window is visible, tip should be "Hide PCKeys", if not=20 > visible, tip > > should be "Show PCKeys". Can this be done? I have tried several > > different things and nothing has worked. I have the=20 > hide/show part in > > my NI_Click sub, but cant change the tip text... Help... > >=20 > > Joe Frazier, Jr > > Technical Support Engineer > > PeopleClick > > 919-645-2916 > > joe...@pe... > > =20 > >=20 > > use Win32::GUI; > >=20 > > $Window =3D new Win32::GUI::Window( > > -name =3D> "Window", > > -topmost =3D> 1, > > -left =3D> 300, > > -top =3D> 400, > > -width =3D> 205, > > -height =3D> 228, > > -maxsize =3D> [205,228], > > -minsize =3D> [205,228], > > -text =3D> "PC 4.0 Keys", > > -maximizebox =3D> 0, > > =20 > >=20 > > ); > >=20 > > $icon =3D new Win32::GUI::Icon('SECUR05.ICO'); > > $Window->ChangeIcon($icon); > > $ni =3D $Window->AddNotifyIcon(-name =3D> "NI", -id =3D> 1, > > -icon =3D> $icon, -tip =3D> = "PCKeys"); > >=20 > > $Window->Show(); > > Win32::GUI::Dialog(); > >=20 > > #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > sub Window_Terminate { > > #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > $ni =3D $Window->AddNotifyIcon(-name =3D> "NI", -id =3D> 1, > > -icon =3D> '', -tip =3D> "Hide = PCKeys"); > > return -1; > > } > >=20 > > sub NI_Click { > > if ($Window->IsVisible){ > > $Window->Disable(); > > $Window->Hide(); > > $Window->NI->{-tip} =3D "Show PCKeys"; > > return 1; > > } > > else { > > $Window->Enable(); > > $Window->Show(); > > $Window->NI->{-tip} =3D "Hide PCKeys"; > > return 1; > > } > > } > >=20 > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > >=20 >=20 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users >=20 |