Setting window styles using Tkinter / Tcl: no exit button

I know that Tkinter is just a thin layer over Tcl / Tk. Tkinter, you can do several things to change the style of the window. One example is root.attributes('-toolwindow', True). This will change the window style as well as the tool window. However, I want to go a little below level.

I suspect that at some point, Tcl / Tk will refresh windows window styles . I am sure that this would have to do this in order to set the window style and finally the Tkinter styling style. I am trying to give a Tkinter window that I am sure is WS_DLGFRAME style . However, I am not sure how to approach this.

I am wondering where in the Tcl / Tk part of Tkinter it assigns window styles and what I need to add in order to get this style.

The ultimate goal is to get a Tkinter window border style that looks like below (note that it lacks the exit button):

enter image description here

This is on Windows 7, BTW.

+3
source share
2 answers

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

I quickly looked in this file too: ./win/tkWinWm.cin line 3072 ( tk859-src.zip) you have a function static int WmAttributesCmd()dealing with -toolwindow, as you said, a later updated one UpdateWrapper().

So there is no easy way to change it unless you change the source code of Tk.

FindWindow Tk window TK_WIN_CHILD_CLASS_NAME, TkChild, SetWindowLongPtr( GWLP_STYLE, ...) ( ffi C ).

Tcl/Tk, . Tcl/Tk?

+3

( , )

root.overrideredirect(True)

.

+5

All Articles