All windows made through Perl TK or Python Tkinter look like default Windows-styled window, with red cancel button on top right, preceded by maximize and minimize buttons, blue top bar, etc. Is it possible to make custom windows, like those we see for downloaded softwares, where everything, right from the color, to position of buttons, their styles, etc are customized?
All windows made through Perl TK or Python Tkinter look like default Windows-styled window,
Share
You can turn off the standard decorations in a few ways, e.g., by setting the
toolwindowboolean attribute (Windows only), by making it anoverrideredirectwindow, or (with a new-enough Tk) by setting thetypeattribute of the window to something likeutility(X11 only). With the standard decorations disabled, you can then draw anything you want (which is how the other programs you mention do things), though there are a number of restrictions, particularly withfocushandling. Override-redirected windows often don’t participate in the keyboard management regime, because they’re mostly invisible to the window manager which doesn’t know to direct focus to them in the first place. (IIRC, you can force it but then you’re getting into a fight with the WM and that’s difficult to get right; “don’t fight the WM” is one of the good rules of thumb for GUI design.) You can also set the window as transient (i.e., working for another window) which often reduces decoration levels.The way you set these things depends on the language you’re using. I can point to the places to look in the “mothership” documentation, but how they work in different languages does vary.