If you don't want to hide the root, but just make sure that the user can only interact with the popup, you can use grab_set() and grab_release() .
b.grab_set() # when you show the popup # do stuff ... b.grab_release() # to return to normal
Alternatively , you can withdraw() to create a root to make it invisible:
a.withdraw()
will leave the root alive, but only b will be visible.
If you need it, you can do
a.deiconify()
Junuxx
source share