Module: html.widgets.widget_button — IPython 2.3.1 documentation

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- home|
- search|
- documentation »
- The IPython API »

# Module: `html.widgets.widget_button`

ButtonWidget class.

Represents a button in the frontend using a widget. Allows user to listen for click events on the button and trigger backend code when the clicks are fired.

## 1 Class

class `IPython.html.widgets.widget_button.` `ButtonWidget`(**kwargs)

  Bases: `IPython.html.widgets.widget.DOMWidget`

  `__init__`(**kwargs)

    Constructor

  `on_click`(callback, remove=False)

    Register a callback to execute when the button is clicked.

    The callback will be called with one argument, the clicked button widget instance.

    Parameters: | remove : bool (optional) Set to true to remove the callback from the list of callbacks.

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- home|
- search|
- documentation »
- The IPython API »