|
|
|
|
@ -17,7 +17,7 @@ Represents an enumeration using a widget.
|
|
|
|
|
from collections import OrderedDict
|
|
|
|
|
from threading import Lock
|
|
|
|
|
|
|
|
|
|
from .widget import DOMWidget
|
|
|
|
|
from .widget import DOMWidget, register
|
|
|
|
|
from IPython.utils.traitlets import Unicode, List, Bool, Any, Dict, TraitError, CaselessStrEnum
|
|
|
|
|
from IPython.utils.py3compat import unicode_type
|
|
|
|
|
from IPython.utils.warn import DeprecatedClass
|
|
|
|
|
@ -114,6 +114,7 @@ class _Selection(DOMWidget):
|
|
|
|
|
self.value_lock.release()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register('IPython.ToggleButtons')
|
|
|
|
|
class ToggleButtons(_Selection):
|
|
|
|
|
"""Group of toggle buttons that represent an enumeration. Only one toggle
|
|
|
|
|
button can be toggled at any point in time."""
|
|
|
|
|
@ -124,7 +125,7 @@ class ToggleButtons(_Selection):
|
|
|
|
|
default_value='', allow_none=True, sync=True, help="""Use a
|
|
|
|
|
predefined styling for the buttons.""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register('IPython.Dropdown')
|
|
|
|
|
class Dropdown(_Selection):
|
|
|
|
|
"""Allows you to select a single item from a dropdown."""
|
|
|
|
|
_view_name = Unicode('DropdownView', sync=True)
|
|
|
|
|
@ -134,13 +135,15 @@ class Dropdown(_Selection):
|
|
|
|
|
default_value='', allow_none=True, sync=True, help="""Use a
|
|
|
|
|
predefined styling for the buttons.""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register('IPython.RadioButtons')
|
|
|
|
|
class RadioButtons(_Selection):
|
|
|
|
|
"""Group of radio buttons that represent an enumeration. Only one radio
|
|
|
|
|
button can be toggled at any point in time."""
|
|
|
|
|
_view_name = Unicode('RadioButtonsView', sync=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register('IPython.Select')
|
|
|
|
|
class Select(_Selection):
|
|
|
|
|
"""Listbox that only allows one item to be selected at any given time."""
|
|
|
|
|
_view_name = Unicode('SelectView', sync=True)
|
|
|
|
|
|