in reply to Re^2: Balloon and menus options
in thread Balloon and menus options

How can I cure this?

it would help if you could come up with a small example that gives the error, and the exact platform you are on..... it now sounds like a different problem, probably unicode related..... and you probably should use strict completely, not just strict 'vars'


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku

Replies are listed 'Best First'.
Re^4: Balloon and menus options
by merrymonk (Hermit) on Dec 07, 2009 at 17:01 UTC
    Below is code that shows the problem. It has two pull down menus.
    I have tried to use an array with messages for the first.
    I have given the messages in [] for the second.
    I have also just just 'strict'.
    In both case it fails to show the message I want to see.
    I am using Perl with Windows XP Professional operating system.
    Therefore any clues as to what is wrong would be excellent.
    use Tk; use Tk::Balloon; use strict ; my ($mw); my (%tooltip_mes, %tooltip_status_mes, %balloon_wg, %wg, @local_option +s, @mes_options, @sta_options, $option_resb, $option_res); $mw = MainWindow->new(-title => "Simple example"); $local_options[0] = 'Option 1'; $local_options[1] = 'Option 2'; $local_options[2] = 'Option 3'; $local_options[3] = 'Option 4'; $mes_options[0] = "tooltip 1\nOption A"; $mes_options[1] = "tooltip 2\nOption B"; $mes_options[2] = "tooltip 3\nOption C"; $mes_options[3] = "tooltip 4\nOption D"; $wg{APullDown_Option} = $mw->Optionmenu( -textvariable => \$option_res, -state => 'normal', -options => [@local_options])->pack; $wg{BPullDown_Option} = $mw->Optionmenu( -textvariable => \$option_resb, -state => 'normal', -options => [@local_options])->pack; $wg{Status_Label} = $mw->Label(-borderwidth => 2, -relief => 'groove') ->pack(-side => 'bottom'); $balloon_wg{pulldown} = $mw->Balloon(-statusbar => $wg{Status_Label}); $balloon_wg{pulldown}->attach($wg{APullDown_Option}, -msg => [@mes_opt +ions]); $balloon_wg{bpulldown} = $mw->Balloon(-statusbar => $wg{Status_Label}) +; $balloon_wg{bpulldown}->attach($wg{BPullDown_Option}, -state => 'ballo +on', -msg => ['A1', 'B2','C3', 'D4']); MainLoop;
      ... i see your problem on linux too.... so i think it is probably a bug in Tk..... but you might try putting "use utf8"; in your script

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku