in reply to dynamic resizing in Tk

You are asking a fairly complex question, without showing any working example to demonstrate the problem. It sounds like you are thinking right in needing to repack the whole program. You might see if withdrawing the mainwindow, and raising it again, will force a redraw. But generally, you should try to keep your buttons in a separate frame, then you can packForget the whole frame, rebuild it with new buttons, then pack it again into the $mw. Or use a separate $toplevel, which you can rebuild out of site, without messing with your $mw.

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: dynamic resizing in Tk
by samizdat (Vicar) on Jan 17, 2005 at 21:27 UTC
    That is what I'm doing. Sorry I didn't include more code; it's a very complex app with many code paths and a lot of symbolic references. All the internal buttons are packForgotten, then $bpanelframe is packForgotten, then the (new) buttons are packed and $bpanelframe is re-packed.

    Thanks for the confirmation that I need to try going all the way out in order to get consistent behaviour.
      Thanks for the confirmation that I need to try going all the way out in order to get consistent behaviour.

      Thats why it is easier to use a separate toplevel window, which you can rebuild out-of-sight.


      I'm not really a human, but I play one on earth. flash japh
        Thanks to your gentle prompting, I believe I've found the answer, from man Tk::Wm:

        GEOMETRY MANAGEMENT By default a top-level window appears on the screen in its natural size, which is the one determined internally by its widgets and geometry managers. If the natural size of a top-level window changes, then the window's size changes to match. A top-level window can be given a size other than its natural size in two ways. First, the user can resize the window manually using the facilities of the window manager, such as resize handles. Second, the application can request a particular size for a top-level window using the geometry method. These two cases are handled identically by Tk; in either case, the requested size overrides the natural size. You can return the window to its natural by invoking geometry with an empty geometry string.

        We'll see... :D
        Hmmm... start at the top...

        man Tk::MainWindow...
        man Tk::Widget...
        man Tk::TopLevel...

        Thanks for your advice, oh Saint! :D