P
Peter Otten
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
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