Depends on what you mean by "disable." If you simply want it to do nothing when the user clicks on it, you can install a "do-nothing" protocol handler for WM_DELETE_WINDOW messages. (See my response to thread287-339303, "capture window's exit event," for more information.) For example, the following effectively disables the function of the close icon:
Code:
wm protocol . WM_DELETE_WINDOW {
# Ignore the message
}
Note that the script can't be an empty string (that is, a 0-character-length string); that instructs Tcl to use its default handler, which is to destroy the window.
On the other hand, if you want to eliminate the "X" icon completely, that's a much more difficult project. Your only option in this case is to use wm overrideredirect to tell the window manager not to manage the window at all. This prevents the window manager from adding the titlebar to the window. It also prevents it from adding resize handles and other decorations. Overrideredirect windows are typically used only for splash screens and other transient windows. - Ken Jones, President, ken@avia-training.com
Avia Training and Consulting,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.