Yesterday I got very useful answers to my question about tooltips working on a second top level widget.
This allowed me to get my test program to work.
I used the same method for my production application.
Sadly this did not work.
As the Perl code below shows I set $att_res to the ‘result’ of attaching the balloon.
In both the test program and main application this is returned as 1.
What steps should I take to try to find out why the ‘allegedly’ attached balloon is not working? For example is there any way of testing if the attachment is really there?
I have tried setting the parameter to –initwait to 1 but that did not have any effect.
use strict "vars"; use Tk; use Tk::TabFrame; use Tk::Balloon; my ($a_tbfr, $tab_mw, $frame_wg); my ($lb_str, $en_str, %tabwg, $tabwg_item, $current_product, $gen_str, + $j, $j_str, %wg, $wg_item, $att_res); my ($msgarea, $balloon_msg, $status_msg, $bl_str); my ($button_sc, $toplevel_entry_wg, $toplevel_wg, $balloon); $current_product = 'unset'; $tab_mw = MainWindow->new; $tab_mw->Label(-text => 'Tabbed Frame to Check Tooltips')->grid(-row = +> 0); # add button that gives additional screen with button $button_sc = $tab_mw->Button( -text => 'See top level widget', -command => sub { $toplevel_wg->deiconify(); $toplevel_wg->raise(); }) ->grid(-row => 2); # create the message area for tooltips $msgarea = $tab_mw->Label(-borderwidth => 2, -relief => 'groove') ->grid(-row => 3); # create a ballon for this message area etc $balloon = $tab_mw->Balloon(-statusbar => $msgarea); # create a TopLevel widget $toplevel_wg = $tab_mw->Toplevel(); # create an entry box and two labels for this toplevel widget $toplevel_wg->Label(-text => "Text above entry box")->grid(-row => 0); $toplevel_entry_wg = $toplevel_wg->Entry(-width => 20)->grid(-row => 1 +, -column=>0); $toplevel_wg->Label(-text => "Text below entry box")->grid(-row => 2); # withdraw the second toplevel widget $toplevel_wg->withdraw(); $att_res = $balloon->attach($toplevel_entry_wg, -balloonmsg => "toplev +el entry box balloon/tooltip", -statusmsg => "toplevel entry box sta +tus"); print "attach result <$att_res> for toplevel Entry balloon\n"; MainLoop;

In reply to 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.