[Pythonmac-SIG] Tkinter : non-resizable, but movable windows

Vincenzo Tschinke tschinke@swissonline.ch
Sat, 5 Sep 1998 22:41:21 +0200


I would like to display modal dialogs that

1) can be freely moved around the screen

2) can't be resized, neither by a) the "Zoom box", nor b) by the "Size box"

In other words, I would like to have a "movableDBoxProc" type of window, as "Inside Macintosh" would put it.

This works only in part:

from Tkinter import *

class Base_Window(Toplevel):
	"""
		modal dialog window
	"""
	def __init__(self, parent, title=''):
		# Toplevel stuff
		Toplevel.__init__(self, parent)

		# "transient" makes the window non-movable!
		#self.transient(parent)

		# OK : removes the "Size box"!
		self.resizable(0, 0)
		
		# bind to the close box (disactivate, only as an example)
		self.protocol("WM_DELETE_WINDOW", self.get_out)

def get_out(self, event=None):
	" Window never closes! "
	pass

The problem with this class is that the "Zoom box" is still visible and does resize the window to full screen if clicked.

Is there a way in Mac-Tkinter to make the "Zoom box" disappear, while keeping the window movable?

Alternatively, it should be possible to disactivate the "Zoom box" by a suitable "self.protocol" method, like above for the close box. Does anybody know the "protocol" for the "Zoom box"? I can't find a complete list for those protocols; the usual sources (web pages, Osterhout book) only mention WM_DELETE_WINDOW, WM_SAVE_YOURSELF, and WM_TAKE_FOCUS. Where to find a complete list?

Thanks,

Vincenzo

=======================
Vincenzo Tschinke
Kernmattstr. 24
CH-4102 Binningen
Switzerland
+4161 422 1991 (T+F)
tschinke@swissonline.ch
=======================