This part of your code makes no sense to me, but I'm not a big user of balloons. You are trying to create a toplevel widget off of a balloon.
# create a ballon for this message area etc $balloon = $tab_mw->Balloon(-statusbar => $msgarea); # create a TopLevel widget $toplevel_wg = $tab_mw->Toplevel();
This is the way to do it.
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::Balloon; my $mw = tkinit; my $msg = 'press to change'; my $b = $mw->Button( -text => 'Power calculation', -command => sub{$msg = $msg . ' again'}, -padx => 10, )->pack( -side => 'top', -anchor => 'center', -pady => 3, ); my $bln = $mw->Balloon( -background => 'LightYellow' ) ->attach( $b, -msg =>\$msg ); MainLoop;
Try to make a simple example like that with your TabFrame. Or look at this:
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::NoteBook; use Tk::Balloon; package Tk::NoteBook; sub BalloonInfo{ my ($nb,$balloon,$X,$Y,@opt) = @_; my $wx = $X - $nb->rootx; my $wy = $Y - $nb->rooty; my $tab = $nb->identify($wx,$wy); unless ($tab){ $balloon->Deactivate; return undef; } foreach my $opt (@opt) { my $info = $balloon->GetOption($opt,$nb); if ($opt =~ /^-(statusmsg|balloonmsg)$/ && (ref $info eq 'HASH')){ return $info->{$tab} if $info->{$tab} ; } return ''; } } package main; my $mw = tkinit; my $statuslabel = $mw->Label()->pack(-side=>'bottom'); my $b = $mw->Balloon(-statusbar=>$statuslabel); my $nb = $mw->NoteBook()->pack; for my $tab (qw/tab1 tab2 tab3/){ my $frame = $nb->add($tab,-label=>$tab); $frame->Label(-text => $tab)->pack; $frame->Label(-text => 'a Label in '.$tab)->pack; } $b->attach($nb, -balloonposition => 'mouse', -balloonmsg =>{tab1=>'Help for tab1', tab2=>'Help for tab2', tab3=>'Help for tab3', }, -statusmsg =>{tab1=>'Status for tab1', tab2=>'Status for tab2', tab3=>'Status for tab3'}, ); MainLoop;

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

In reply to Re: Failing toplevel balloon by zentara
in thread Failing toplevel balloon by merrymonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.