[Tkinter-discuss] Removing/disabling a resizable window's maximize button under Windows

python at bdurham.com python at bdurham.com
Thu Dec 2 05:31:00 CET 2010


Looking for advice on how to remove or disable a *resizable*
window's maximize button under Windows. I'm using Python 2.7 for
Windows.

Background: I have a resizable window with min and max sizes set
via the window's minsize() and maxsize() methods. When a user
clicks the maximize button, the window moves to the upper left of
the display. This is very confusing to my users so I would like
to prevent that behavior.

My research shows several ways to disable a maximize button - but
none of these techniques seem to apply to resizable windows?

1. Prevent a window from resizing via the resizable( False, False
) method.

2. Remove all the window's controls (and border) via the
overrideredirect( True ) method.

3. Use the mysterious transient(1) method (this raises an
exception under Windows).

Is there a way I can trap the maximize event (what event to bind
to?) and return "break" to prevent the maximize from happening
(or better yet, substitute my own behavior instead)?

Thank you,
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20101201/41c8fd5e/attachment.html>


More information about the Tkinter-discuss mailing list