in reply to Tooltips for Tk widgets in perl - easier than ever
my $tooltip1 = Gtk2::Tooltips->new; my $tip_text1 = 'Just Another Exit Button'; $tooltip1->set_tip($button, $tip_text1, undef);
and it's not really that much harder in Perl/Tk. The real difficulty with balloons comes, when you need to dynamically change them at post time.
#!/usr/bin/perl #by Jack D. # Just attach the balloon to the widget itself instead # of treating it like a canvas item. # The script below shows both. ## Example ## use Tk; use Tk::Balloon; use strict; my $mw=tkinit; my $c=$mw->Canvas->pack; my $l = $c->Label(-relief=>'sunken',-text=>'embedded window'); $c->create('window',150,150,-window=>$l); $c->create('text', 150,100,-text=>"A Text Canvas Item",-tags=>'TESTTAG +'); my $ba = $mw->Balloon(-background=>'yellow'); $ba->attach($l,-initwait=>0,-balloonmsg=>'Attached to Widget'); $ba->attach($c, -initwait=>0, -balloonposition => 'mouse', -msg=>{ 'TESTTAG'=>'A Canvas Item'} ); MainLoop; __END__
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Tooltips for Tk widgets in perl - easier than ever
by vkon (Curate) on Jul 14, 2007 at 16:12 UTC | |
by zentara (Cardinal) on Jul 14, 2007 at 17:40 UTC | |
by vkon (Curate) on Jul 14, 2007 at 17:52 UTC | |
by zentara (Cardinal) on Jul 15, 2007 at 11:51 UTC |