On Dec 29, 3:23 pm, akineko <akin...@gmail.com> wrote:
> Hello everyone,
>
> I'm writing a Tkinter program and trying to constraint the window
> size.
> I want to set the minimum of the width and the height and the maximum
> of the width, but not the height.

You want to set the max height to 0.  I know this is counter-
intuitive. Both values must be a number or None, not mixed.  So to do
what you want to do it would be this:

some_window.wm_minsize(width=min_width, height=min_height)
some_window.wm_maxsize(width=max_width, height=0)

Note that these numbers are in pixels if you're using .pack() and
according to the docs it's in grid coordinates if you're using .grid()

Good luck!
Roger.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to