how to disable maximize button?

Cameron Laird claird at starbase.neosoft.com
Sun Jul 7 08:31:52 EDT 2002


In article <ornV8.47900$vm5.1715632 at news2.tin.it>,
Alex Martelli  <aleax at aleax.it> wrote:
>jubafre at zipmail.com.br wrote:
>
>> how i can disable de maximise button in tkinter, i don´t want the user
>> modific the size of the window, i want a real size of window, how can i do
>> it???
>
>You can remove all decorations:
>
>import Tkinter
>root = Tkinter.Tk()
>root.overrideredirect(1)
>
>Apart from this, you may choose to fix the size:
>
>import Tkinter
>root = Tkinter.Tk()
>root.resizable(0,0)
>
>
>I know of no way to affect the maximize button ONLY, without also
>affecting other ways to resize the window, but then from your post's
>text I don't see why you should ONLY want to affect said button.
>
>
>Alex
>
>

It is possible, though.  That is, I believe, without making
the time to verify this myself, that there's an effective way
to achieve this under crucial window managers.

You're right, Alex, that overrideredirect achieves what makes
sense in this area.  However, as I believe you know, many
vertical applications Windows hosts are configured with maximize
and remove-window buttons disabled, leaving only iconify.  Clients
expect to see this, whatever we think of its (ir)rationality.  Al-
though Tkinter proper doesn't provide a means to achieve this,
there are win32 calls accessible through *that* module that 
make it happen.

I've forgotten what they are.  If I were going to pursue this,
I'd check with operating-system experts for the correct lower-
level calls.
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list