merrymonk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl use strict; use warnings; use Tk; use Tk::Balloon; my ($att_res); my $mw = MainWindow->new(); $mw->title('Simple example'); my $status = $mw->Label( -width => 20, -relief => 'groove', )->pack(); my $balloon = $mw->Balloon(-statusbar => $status, -initwait => 1); my $menu = $mw->Optionmenu( -textvariable => \my $res, -options => [qw(A B C D)], )->pack(); $att_res = 1234; $att_res = $balloon->attach( $menu, # pass the Tk::Menu instance # the next line gave many errors of the form #Malformed UTF-8 character (unexpected non-continuation byte 0xe5, imm +ediately after start byte 0xf0) # in subroutine entry at ......./lib/Tk.pm line 469. # -balloonmsg => [qw(a b c d)], -balloonmsg => 'foo', -statusmsg => 'foo', # this works, but you get the same msg for all menu entries, of co +urse ); print "att_res <$att_res\n"; MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Tk - Varying balloon message on optionmenu
by beech (Parson) on Mar 17, 2016 at 23:52 UTC | |
by merrymonk (Hermit) on Mar 18, 2016 at 08:53 UTC |