Skip to content
Advertisement

How to make pop-up window with force attention in Tkinter

I want to create a window which doesn’t allow the user to access other windows until you give an input. I tried win.attribute("ontop", True) but it allows the user to access other windows. or is there any function like a force_focus_lock() in Tkinter python 3.8 which doesn’t allow other window to get focus until you give a input or the close present window.

Advertisement

Answer

I believe the below is what you are trying to do. Explanation is given in comments.

method #1: (PopOut1)

  • you can still move the main window
  • the new window assumes focus if there is a mouse release on main window

method #2: (PopOut2)

  • the main window is locked in place
  • the new window will assume focus, blink and “ding” if there is a mouse release on main window

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement