I have complicated TK window. The data and buttons in the window relate to a variable $product that can take one of several values. The window has many widgets: menus, labels, option buttons, entry forms, etc. All of these widgets depend on the currently selected $product.
The user can select a product to work on from a top menu in the window.
Currently, I am doing something brutish to rebuild the window when the user selects a new product to work on:
# note: $TOP is a global, the MainWindow
sub create_screen {
$TOP->destroy if $TOP; # brutish!
$TOP = MainWindow->new( title => 'product' );
$TOP->optionAdd( "*tearOff", "false" );
... etc ...
Destroying the whole window seems a very crude way to refresh it. It also causes a noticable blink of almost a second.
What's the polite way to redraw the screen, if some of the widgets weren't/can't be tied with $textvariable, etc?
Thanks, gang, for all the TK advice and help.
It is very much appreciated --
waterwaterwater
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.