Make a Tkinter Toplevel active

前端 未结 6 1356
灰色年华
灰色年华 2020-12-10 08:57

I am trying to make a Toplevel widget that is the active window on the screen (I want it so that if you press Enter, it exits the window. I already h

6条回答
  •  执念已碎
    2020-12-10 09:30

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

提交回复
热议问题