IPython Documentation

Table Of Contents

Previous topic

Module: html.widgets.widget_bool

Next topic

Module: html.widgets.widget_container

This Page

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.