Skip to content

Commit

Permalink
fix ipynb PushButton (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjinliu committed Oct 22, 2022
1 parent f4c605f commit cc3cfd8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion magicgui/backends/_ipynb/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,14 @@ class PushButton(_IPyButtonWidget):
_ipywidget: ipywdg.Button

def _mgui_bind_change_callback(self, callback):
self._ipywidget.on_click(lambda e: callback())
self._ipywidget.on_click(lambda e: callback(False))

# ipywdg.Button does not have any value. Return False for compatibility with Qt.
def _mgui_get_value(self) -> float:
return False

def _mgui_set_value(self, value: Any) -> None:
pass


class CheckBox(_IPyButtonWidget):
Expand Down

0 comments on commit cc3cfd8

Please sign in to comment.