FAQ
How can I close a popup menu in Tkinter by clicking elsewhere on the
toplevel window underneath?

I tried popup.grab_set() but this causes the popup to close immediately.

An alternative would be

def hidepopup(event=None):
popup.unpost()
return "break"

root.bind_all("<Button-1>", hidepopup)

but I'd then need a way to make sure that other bindings in children are not
processed or only processed after hidepopup.

Any hints welcome,
Peter

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 26, '04 at 11:19a
activeFeb 26, '04 at 11:19a
posts1
users1
websitepython.org

1 user in discussion

Peter Otten: 1 post

People

Translate

site design / logo © 2022 Grokbase