happyed has asked for the wisdom of the Perl Monks concerning the following question:

I am having problems in a standard Tk application with restricting my TopLevel Window from resizing when subwidgets resize. Application comes up with the size i want... I then replace frames dynamically based on database queries. The window never stays the same size - growing and shrinking to fit - its ugly... i want to use scrollbars in a fixed size outer window.

I have tried fooling with geometry(), minsize(), maxsize() etc... $toplevel->resizable() stops me from resizing it but does not stop the dynamic resizing (ie. it does things exactly backwards) - i want to allow me to resize - but prohibit the window manager from doing the same...

Any Ideas? Im on win2k using a variety of standard Tk modules.

Thanks
Ed

Edit by castaway, added formatting

Replies are listed 'Best First'.
Re: Fixed Width Tk Windows
by gri6507 (Deacon) on Jul 01, 2004 at 03:56 UTC
    if you use the place geometry manager you should be able to get what you want. This way, you could position everything once and then as frames expand, collapse, the absolute position of everything should keep the window steady.
Re: Fixed Width Tk Windows
by Ven'Tatsu (Deacon) on Jul 01, 2004 at 15:20 UTC
    If your using pack to do geometry management look at packPropagate I belive other managers have similar functions.

    From Tk::pack
    $master->packPropagate?(boolean)?
    If boolean has a true boolean value such as 1 or on then propagation is enabled for $master, (see GEOMETRY PROPAGATION below). If boolean has a false boolean value then propagation is disabled for $master. In either of these cases an empty string is returned. If boolean is omitted then the method returns 0 or 1 to indicate whether propagation is currently enabled for $master. Propagation is enabled by default.

    GEOMETRY PROPAGATION

    The packer normally computes how large a master must be to just exactly meet the needs of its slaves, and it sets the requested width and height of the master to these dimensions. This causes geometry information to propagate up through a window hierarchy to a top-level window so that the entire sub-tree sizes itself to fit the needs of the leaf windows. However, the packPropagate method may be used to turn off propagation for one or more masters. If propagation is disabled then the packer will not set the requested width and height of the packer. This may be useful if, for example, you wish for a master window to have a fixed size that you specify.
Re: Fixed Width Tk Windows
by zentara (Cardinal) on Jul 01, 2004 at 14:16 UTC
    A longshot worth mentioning...
    use Tk::Wm; $toplevel->sizefrom('user') #can be 'user' or 'program'

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