> -----Original Message-----
> From: az...@nusaxcess.com [mailto:az...@nusaxcess.com] 
> Sent: 25 February 2010 03:54
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] Need to dynamically change the -tip
> 
> Hi,
> 
> I have developed a software using Win32::GUI and I need to have my  
> user to choose their desired language during the time when 
> they login  
> to the system. This will change not only the interface language but  
> also the tooltip. I don't have any problem doing so for 
> others but for  
> the -tip I've never succeeded.

Hi Azlan.

If you used an explicit Tooltip object instead of the -tip option, it
has a
special method to change the text. A Tooltip is a set of tooltips rather
than a
single one, so common methods (such as Text) don't work as I had
expected.

For example:

use Win32'GUI '';
my $w = Win32'GUI'Window->new('-text', 'Window', '-size', [100, 100]);
my $b = $w->AddButton('-text', 'test');
my $c = $w->AddButton('-text', 'test', '-pos', [0, 50]);
my $t = $w->AddTooltip();
$t->AddTool('-text', 'Click me.', '-subclass', 1, '-window', $b);
$t->AddTool('-text', 'Click me too.', '-subclass', 1, '-window', $c);
$b->Change('-onClick', sub() {$t->UpdateTipText($b, 'Cliquez moi.')});
$c->Change('-onClick', sub() {$t->UpdateTipText($c, 'Cliquez moi
aussi.')});
$w->Show;
Win32'GUI'Dialog;

The other way to change the text is to recreate the component which has
the
tooltip, but the above should usually be simpler.

Kieron

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to