From e84e1d2df6c782f10b0f2fe24256aaa6f393ffe9 Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Fri, 1 Nov 2013 21:15:28 +0000 Subject: [PATCH] Fixed button on_click handler so it's initiated on instanciation --- IPython/html/widgets/widget_button.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IPython/html/widgets/widget_button.py b/IPython/html/widgets/widget_button.py index 9883038e9..f68767001 100644 --- a/IPython/html/widgets/widget_button.py +++ b/IPython/html/widgets/widget_button.py @@ -33,7 +33,10 @@ class ButtonWidget(Widget): description = Unicode('', help="Description of the button (label).") disabled = Bool(False, help="Enable or disable user changes.") - _click_handlers = [] + + def __init__(self, **kwargs): + self._click_handlers = [] + super(ButtonWidget, self).__init__(**kwargs) def on_click(self, callback, remove=False):