From 6110e1c30773d4a3c1c50162d93b8750eccdf3d3 Mon Sep 17 00:00:00 2001 From: Jonathan Frederic Date: Mon, 4 Nov 2013 23:53:41 +0000 Subject: [PATCH] Updated ButtonWidget onclick description --- IPython/html/widgets/widget_button.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/IPython/html/widgets/widget_button.py b/IPython/html/widgets/widget_button.py index f68767001..3675428d3 100644 --- a/IPython/html/widgets/widget_button.py +++ b/IPython/html/widgets/widget_button.py @@ -40,12 +40,17 @@ class ButtonWidget(Widget): def on_click(self, callback, remove=False): - """Register a callback to execute when the button is clicked. + """Register a callback to execute when the button is clicked. The + callback can either accept no parameters or one sender parameter: + - callback() + - callback(sender) + If the callback has a sender parameter, the ButtonWidget instance that + called the callback will be passed into the method as the sender. Parameters ---------- remove : bool (optional) - Set to tru to remove the callback from the list of callbacks.""" + Set to true to remove the callback from the list of callbacks.""" if remove: self._click_handlers.remove(callback) else: