Setting window styles with Tkinter/Tcl: no exit button Setting window styles with Tkinter/Tcl: no exit button tkinter tkinter

Setting window styles with Tkinter/Tcl: no exit button


The following option instructs the window manager not to decorate the window (i.e no title bar and window buttons, plus no borders)

root.overrideredirect(True)

A false argument restores the decorations.


If you are familiar with C, download Tk source code.

I've looked quickly, and in this file:./win/tkWinWm.c at line 3072 (tk859-src.zip), you have the function static int WmAttributesCmd(), dealing with -toolwindow as you've said, later updated by UpdateWrapper().

So no easy way to change it, unless you change Tk source code.

Alternatively you might be able to use FindWindow and look for Tk's window class TK_WIN_CHILD_CLASS_NAME defined to be TkChild, and then use SetWindowLongPtr( GWLP_STYLE, ...) to change the style (but this requires some ffi call to C or other means).

I myself I'm not familiar with neither Tcl/Tk, so take it with a grain of salt. Why not try the Tcl/Tk community?