0

I've implemented the code I found in another question, and I'm wondering why it works.

This is the code that makes a Tkinter window topmost in mac, and then doesn't when it's idle (if that makes sense)

root.lift()
root.call('wm', 'attributes', '.', '-topmost', True)
root.after_idle(root.call, 'wm', 'attributes', '.', '-topmost', False)

How would I make it work in Windows, for example?

Community
  • 1
  • 1
MPKenning
  • 569
  • 1
  • 7
  • 22
  • What this does is make the window start off as topmost, and then go back to normal immediately after it appears. The only reason you'd want to do this is a workaround for the Mac-specific [bug #9384](http://bugs.python.org/issue9384). Since that bug doesn't happen on Windows, you don't need to do anything. – abarnert Nov 13 '13 at 01:13
  • 1
    If you're asking about one of the specific parts of this—setting window attributes in general, the topmost attribute in particular, using `after_idle`, etc.—everything in that code is cross-platform and will do the same thing on Windows as on Mac. (Which, again, when put all together will have no desirable visible effect on Windows.) – abarnert Nov 13 '13 at 01:16

0 Answers0