# tabframe-m use strict "vars"; use Tk; use Tk::TabFrame; my ($a_tbfr, $tab_mw, $b_tbfr, $frame_wg, %lbwg, %entrywg); my ($label_text, $CurrentSelection, $child, $childb, $childc, $childd); my ($CurrentSelectionC, $CurrentSelectionR, %tabwg, $tabwg_item, $current_product, $gen_str); my ($gen_intials, $gen_str, $gen_whog, $gen_whoa, $gen_whob, $gen_whoc, $pb_intials, $pa_intials, $pb2_intials, $j, $j_str); my ($lb_str, $en_str, $cap_retrieved, $lab_retrieved, $lb_text, $text_retrieved, $top_wg); $current_product = 'unset'; $tab_mw = MainWindow->new; $top_wg = $tab_mw->Label(-text => 'Caption query')->grid(-row => 0); $text_retrieved = $top_wg->cget(-text); print "top_wg $top_wg retrieved text $text_retrieved\n"; $a_tbfr = $tab_mw->TabFrame ( -font =>'-adobe-times-medium-r-bold--14', -tabcurve =>4, -padx => 10, -pady => 10, -width => 50 ); $a_tbfr->grid ('-row' => 1); for($j = 1; $j <= 1; $j ++) { $j_str = "Tab " . $j; # this sets the caption which can be seen $tabwg{$j_str} = $a_tbfr->Frame ( -caption => $j_str, ); # this trys to retrieve the caption but nothing is returned $cap_retrieved = $tabwg{$j_str}->cget( -caption); print "widget name $j_str wg $tabwg{$j_str} caption set $j_str retrieved [$cap_retrieved]\n"; $lb_str = "Tab " . $j . '_Label'; $lb_text = "Text in Label in $j_str"; $lbwg{$j_str} = $tabwg{$j_str}->Label(-text => $lb_text, -width => 100)->grid(-row => 2, -column=>0); $lab_retrieved = $lbwg{$j_str}->cget( -text); print "text given $lb_text wg $tabwg{$j_str} retrieved $lab_retrieved\n"; $en_str = "Tab " . $j . '_Entry'; $tabwg{$j_str}->Entry (-text => $en_str, -width => 20)->grid(-row => 3, -column=>0); } foreach $tabwg_item (keys %tabwg) { print "item $tabwg_item wg $tabwg{$tabwg_item}\n"; # this trys to reset the caption for the tabbed frame child $tabwg{$tabwg_item}->configure(-caption => 'New Caption'); } print "\n"; MainLoop;