Ah, that's the downside of using
wm overrideredirect. As the window manager doesn't provide any decorations, there's no way by default for the user to move or resize the window.
Your application can programmatically change the size and position of the window using the
wm geometry command. But to give the user the chance to move or resize the window, you'd have to create your own set of widget controls, along with bindings that issued the proper
wm geometry commands.
If this is all sounding like a lot of work, that's because it is.
wm overrideredirect is meant to circumvent the window manager for special, transient windows. Trying to then re-implement much of the window manager's functionality in Tcl is usually a bad idea. If you're seriously thinking of starting down this path, I'd suggest that an override-redirect window really isn't appropriate for your situation.
If your goal is to reduce the amount of window manager decorations on a window, you might try
wm transient instead of
wm overrideredirect.
wm transient marks a window as a "transient" window working on behalf of another "master" toplevel. Most window managers usually give such windows a limited set of decorations. On Windows, they get the title and a close icon. If you wanted, you could then even disable the close icon (though it would still appear) by installing a WM_DELETE_WINDOW protocol handler that did nothing when the user tried to close the window. Here's how you'd put it together:
Code:
toplevel .dialog
wm transient .dialog .
wm protocol .dialog WM_DELETE_WINDOW {
# Ignore close icon
}
label .dialog.l -text {Click "Ok" to close}
button .dialog.ok -text "Ok" -command {
destroy .dialog
}
pack .dialog.l .dialog.ok -padx 4 -pady 4
- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting,
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax