How to create window in tcl without title bar

1.7k views Asked by At

How can I create a window in tcl using its window manager (wm) so that there is no title bar. wm title "abc" ; if I miss this then tcl's window manager gives its own name.

1

There are 1 answers

2
Donal Fellows On

To remove the window manager decorations entirely, use wm overrideredirect before the toplevel window is first mapped (typically immediately after creating the toplevel) to request that it be mapped as an unmanaged window; this is what things like menus and tooltips do for you behind the scenes.

set t [toplevel .abc]
wm overrideredirect $t 1
# Fill out the contents

Be aware that this can interact “interestingly” with focus management, and that on X11 you should also set the -type attribute appropriately, such as in:

wm attributes $t -type tooltip

You might instead be better in some cases to make the window into a transient for another window, which (usually) changes the window decoration but not quite as radical as making it override-redirected.

# e.g., this makes the window a transient of the main window
wm transient $t .

If you're making a full-screen undecorated window though, that's best done via:

wm attributes $t -fullscreen 1