1

I want my application to use Toplevel windows without frames, but when I try to use overrideredirect right after creating the Toplevel, it isn't displayed at all. If I call overrideredirect separately, for example by pressing a button that calls it for the last created Toplevel, it works as expected. Is this behavior somehow intended, or at least sensible? How can I work around it?

doru
  • 9,022
  • 2
  • 33
  • 43
Tal
  • 181
  • 8
  • Can you give us an example program that exhibits this behavior? What you say is happening is not intended behavior, and I don't recall anyone noticing this before. – Bryan Oakley Dec 24 '12 at 13:31
  • 1
    Isn't your `Toplevel` simply under another window created by your program ? What happens if you raise it ? For instance, check http://pastebin.com/A5D7RpWa for an example. – mmgp Dec 27 '12 at 21:18
  • I am having the same problem, as soon as I added the overriderredirect(True) to my code, the window no longer shows up. If I remove it, it works as expected, but I want to get rid of the titlebar. – Ethan Post May 16 '13 at 05:33
  • Some more info. I am trying to make a modal window with no title bar. When I remove the lines "self.toplevel.transient(root)" and "self.toplevel.grab_set()", overrideredirect starts working, but I lose my modal window. – Ethan Post May 16 '13 at 12:37

2 Answers2

0

Found a link which fixed he issue for me.

http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/toplevel.html

Be sure to call the .update_idletasks() method (see Section 26, “Universal widget methods”) before setting this flag. If you call it before entering the main loop, your window will be disabled before it ever appears.

Ethan Post
  • 3,020
  • 3
  • 27
  • 27
0

I experienced the same problem on macOS 10.12.5 with Python 3.6.1 and tcl/tk 8.5.18 (see this question). As suggested in comments above, calling .lift() on the toplevel window right after .overrideredirect(True) is called fixed the problem for me.

Sam
  • 191
  • 1
  • 7