[Followups set to comp.lang.perl.tk.]
: Does Perl/Tk have the ability to create small popup windows when a user
: holds their button over a widget for a specified amount of time? What I'm
: referring to is something similar to those small, yellow help windows that
: pop up over a button/icon after 3 or 4 seconds if a user wants a short
: summary of what something does.
: Are there any similar widgets in Tk?
Here's a quick example:
#! /usr/local/bin/perl
use warnings;
use strict;
use Tk;
use Tk::widgets qw/ Balloon Button /;
sub b1 {
print "Button 1 pressed...\n";
}
sub b2 {
print "Button 2 pressed...\n";
}
my $mw = new Tk::MainWindow;
my $f = $mw->Frame(-bd => 2);
my $b1 = $f->Button(-text => "Button 1", -command => \&b1);
my $b2 = $f->Button(-text => "Button 2", -command => \&b2);
my $balloon = $f->Balloon(
-initwait => 3000,
-balloonposition => 'mouse'
);
$balloon->attach($b1, -msg => "This is Button 1.");
$balloon->attach($b2, -msg => "This is Button 2.");
$b1->pack(-side => 'left');
$b2->pack(-side => 'left');
$f->pack;
MainLoop;
Hope this helps,
Greg
--
Greg Bacon, Libertarian for Alabama Senate (District 7)
Mission: Fighting for small, just, inexpensive, non-intrusive government
Remember: The only pork Alabama needs is Bacon!
URL: http://www.VoteBacon.com/