You may want to rethink your design. I would guess that not *everything* changes.. At least the menu from which a product can be chosen is the same, I assume? Probably other menus are too, more or less.

If you want to keep the current design, it may be nicer (quicker refresh), if you change the labels of things, rather than redraw the entire lot. Unless the layout changes per product? Ie. When creating menus, buttons, checkboxes etc, the first time, keep a reference to the actual created object around, maybe in a nice hash hierarchy, and when a different product is selected, go through the hash and update the text/variable/label properties of the objects.

If you can change the design, I'd suggest a top window that stays the same, even if it does just contain a menubar, and sub windows, or DialogBoxes (new top windows) for each product selected. That way also, your users can compare product data, should they ever want to ,) (And these subwindows you can destroy and redraw.. or just draw another one when another product is selected, and give each an explicit close button)

C.


In reply to Re: TK: rebuild entire main window, more elegant soln? by castaway
in thread TK: rebuild entire main window, more elegant soln? by water

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.