I did not try this, but when setting a hash value doesn't work with a GUI
object, Aldo sometimes tells us to use the Change method instead. I.e.

          $Window->NI->Change(-tip => "Show PCKeys");
instead of
          $Window->NI->{-tip} = "Show PCKeys";

Worth trying.
Have fun,
Harald

> -----Original Message-----
> From: Frazier, Joe Jr [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 13, 2001 08:19
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] RE: How to change tip for Notify Icon
> 
> 
> Below is part of some code.  I want to be able to change the 
> Notify Icon
> tip based on the status of the main window:
> 
> If window is visible, tip should be "Hide PCKeys", if not visible, tip
> should be "Show PCKeys".  Can this be done?   I have tried several
> different things and nothing has worked.  I have the hide/show part in
> my NI_Click sub, but cant change the tip text... Help...
> 
> Joe Frazier, Jr
> Technical Support Engineer
> PeopleClick
> 919-645-2916
> [EMAIL PROTECTED]
>  
> 
> use Win32::GUI;
> 
> $Window = new Win32::GUI::Window(
>     -name   => "Window",
>     -topmost => 1,
>     -left   => 300,
>     -top    => 400,
>     -width  => 205,
>     -height => 228,
>     -maxsize  => [205,228],
>     -minsize  => [205,228],
>     -text   => "PC 4.0 Keys",
>  -maximizebox => 0,
>  
> 
> );
> 
> $icon = new Win32::GUI::Icon('SECUR05.ICO');
> $Window->ChangeIcon($icon);
> $ni = $Window->AddNotifyIcon(-name => "NI", -id => 1,
>                                -icon => $icon, -tip => "PCKeys");
> 
> $Window->Show();
> Win32::GUI::Dialog();
> 
> #=====================
> sub Window_Terminate {
> #=====================
> $ni = $Window->AddNotifyIcon(-name => "NI", -id => 1,
>                                -icon => '', -tip => "Hide PCKeys");
>     return -1;
> }
> 
> sub NI_Click {
>  if ($Window->IsVisible){
>   $Window->Disable();
>          $Window->Hide();
>          $Window->NI->{-tip} = "Show PCKeys";
>   return 1;
>  }
>  else {
>          $Window->Enable();
>          $Window->Show();
>          $Window->NI->{-tip} = "Hide PCKeys";
>   return 1;
>  }
> }
> 
> _______________________________________________
> 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