aplonis has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to put a balloon on a menubar. I have the menu configured as/per "Mastering Perl/Tk" (copyright 2002) page 261, as shown below.
Shown is much simplified from my actual code. My menu works. My balloons also work for ordinary widgets.
What I can't figure out is how to attach a balloon to the menu. Help, please?
$mw->configure(-menu => my $menubar = $mw->Menu); # Build a menu bar for special options. map {$menubar->cascade( -label => '~' . $_->[0], menuitems => $_->[1]) +} ['First', menuitems]; # List of menu entries.... sub menuitems { [ ['command', 'Do This', -command => sub { print "foo" } ], + '', ['command', 'Do That, -command => sub { print "bar" } ], + '', ['command', 'Do Other', -command => sub { print "wtf" } ], ]; }; # Explain about the menu thingie. $balloon->attach( $mw->WHAT_SHOULD_I_PUT_HERE, -balloonmsg => 'Do something', -statusmsg => q{Tell much more here..}, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Attaching balloons to menubar entries...
by zentara (Cardinal) on Nov 09, 2007 at 17:27 UTC |