use strict "vars"; use Tk; use Tk::TabFrame; 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); # create the tabbed frame $a_tbfr = $tab_mw->TabFrame ( -font =>'-adobe-times-medium-r-bold--14', -tabcurve =>4, -padx => 10, -pady => 10, -width => 400 ); # create the message area for tooltips $msgarea = $tab_mw->Label(-borderwidth => 2, -relief => 'groove') ->grid(-row => 3); # create the tabbed frames each with a label and entry box $a_tbfr->grid ('-row' => 1); for($j = 1; $j <= 3; $j ++) { $j_str = "Tab " . $j; $tabwg{$j_str} = $a_tbfr->Frame ( -caption => $j_str, ); $lb_str = "Tab " . $j . '_Label'; $wg{$lb_str} = $tabwg{$j_str}->Label(-text => "Text in Label in $j_str", -width => 50)->grid(-row => 2, -column=>0); $en_str = "Tab " . $j . '_Entry'; $wg{$en_str} = $tabwg{$j_str}->Entry (-text => $en_str, -width => 20)->grid(-row => 3, -column=>0); $bl_str = "Tab " . $j . '_Balloon'; $wg{$bl_str} = $tabwg{$j_str}->Balloon(-statusbar => $msgarea); $balloon_msg = "Tab " . $j . " balloon / tooltips message"; $status_msg = "Tab " . $j . " status message"; $att_res = $wg{$bl_str}->attach($wg{$en_str}, -balloonmsg => $balloon_msg, -statusmsg => $status_msg); print "attach result <$att_res> for balloon <$bl_str>\n"; } # 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); $balloon = $toplevel_entry_wg->Balloon(-statusbar => $msgarea); print "balloon <$balloon>\n"; $att_res = $balloon->attach($balloon, -balloonmsg => "toplevel entry box balloon/tooltip", -statusmsg => "toplevel entry box status"); print "attach result <$att_res> for toplevel Entry balloon\n"; MainLoop;