core: fixed handling of button callback in popups:
Button use themselve as callback, and this was causing troubles in the removePopUp method. This patch work around this by considering a Button widget in the same way as None (we never use Button directly in popups). fix 183
This commit is contained in:
parent
adc5204b1a
commit
d2064fc175
1 changed files with 3 additions and 1 deletions
|
|
@ -595,7 +595,9 @@ class PrimitivusApp(QuickApp, InputHistory):
|
|||
@param widget(None, urwid.Widget): if not None remove this popup from front or queue
|
||||
"""
|
||||
# TODO: refactor popup management in a cleaner way
|
||||
if widget is not None:
|
||||
# buttons' callback use themselve as first argument, and we never use
|
||||
# a Button directly in a popup, so we consider urwid.Button as None
|
||||
if widget is not None and not isinstance(widget, urwid.Button):
|
||||
if isinstance(self.loop.widget, urwid.Overlay):
|
||||
current_popup = self.loop.widget.top_w
|
||||
if not current_popup == widget:
|
||||
|
|
|
|||
Loading…
Reference in a new issue