Thanks everyone for all the Tk help. I've changed my app to use
-textvariables heavily, so the display changes as the underlying data changes. Now, all that remains is to understand / solve / engineer-around the tab issue:
I'm trying to add tabs to a notebook dynamically while the program is running, after MainLoop has started.
# silly toy example
use strict;
use Tk;
use Tk::NoteBook;
my $i=0;
my $top = MainWindow->new( );
my $nb = $top->NoteBook();
$top->repeat(200, \&add_tab);
&add_tab() for 1 .. 20;
MainLoop();
sub add_tab {
exit if $i>50;
$i++;
print "adding tab $i\n";
my $tab = $nb->add($i, -label => $i );
$nb->pack;
}
Here, the first 20 tabs are added fine, as MainLoop hasn't started yet, but the later tabs don't show up.
Without destroying and rebuilding the entire top window, how can I add a tab to a notebook after MainLoop has started?
Thanks!
water
20041011 ysth Reparented under later duplicate
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.