Mercurial > libervia-backend
changeset 3016:0b1c17c24bba
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
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 19 Jul 2019 23:04:35 +0200 (2019-07-19) |
parents | 7b8d40b17451 |
children | e7cbe662838b |
files | sat_frontends/primitivus/primitivus |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/sat_frontends/primitivus/primitivus Fri Jul 19 23:01:57 2019 +0200 +++ b/sat_frontends/primitivus/primitivus Fri Jul 19 23:04:35 2019 +0200 @@ -595,7 +595,9 @@ @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: