views:

73

answers:

2

Is there any way to get a border like this in Tkinter? Notice how it lacks the buttons on the top right. Also I don't want this program to show in the task bar.

alt text

This is in windows 7, btw.

A: 

The WS_DLGFRAME window style should give you a window without a titlebar and WS_EX_TOOLWINDOW is normally also used for a window like this so it is not visible in the taskbar (Or with a hidden parent window like control panel dialogs before Vista) You can figure out the exact window styles with a tool like Spy++ (Visual Studio) or WinSpy++

Anders
I can't seem to get it to work in Tkinter, what do those little bit's look like implemented?
Anteater7171
@anteater7171: http://www.pythonware.com/library/tkinter/introduction/x9843-style-methods.htm documents a overrideredirect method that will remove thetitlebar and borders, if that is not enough you must set the native window style, I'm not sure if Tkinter gives you that kind of low-level access, if not, try the something like http://twapi.magicsplat.com/ui.html#set_window_style TCL extension
Anders
A: 

Tk (and thus, Tkinter) has a command for removing all window manager decoration. This command in tkinter is the "wm_overrideredirect" method of toplevel windows. Pass it a parameter of True to remove the window manager decorations. You can then draw whatever borders you want, usually by packing a canvas over the entire window and drawing on the canvas.

However, when I experiment with this on my Mac, the window appears properly but won't take focus. Perhaps this is a bug in Tkinter. I don't see the same problem with identical code in Tcl.

Bryan Oakley