Skip to content

Commit

Permalink
allow_none=False for button_style
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainCorlay committed Nov 17, 2017
1 parent dad1af2 commit 945dda6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ipywidgets/widgets/widget_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class _Selection(DescriptionWidget, ValueWidget, CoreWidget):

_options_full = None

# This being read-only means that it cannot be changed from the frontend!
# This being read-only means that it cannot be changed by the user.
_options_labels = Tuple(read_only=True, help="The labels for the options.").tag(sync=True)

disabled = Bool(help="Enable or disable user changes").tag(sync=True)
Expand Down Expand Up @@ -388,6 +388,7 @@ class ToggleButtonsStyle(DescriptionStyle, CoreWidget):
_model_name = Unicode('ToggleButtonsStyleModel').tag(sync=True)
button_width = Unicode(help="The width of each button.").tag(sync=True)


@register
@doc_subst(_doc_snippets)
class ToggleButtons(_Selection):
Expand Down Expand Up @@ -424,7 +425,7 @@ class ToggleButtons(_Selection):

button_style = CaselessStrEnum(
values=['primary', 'success', 'info', 'warning', 'danger', ''],
default_value='', allow_none=True, help="""Use a predefined styling for the buttons.""").tag(sync=True)
default_value='', help="""Use a predefined styling for the buttons.""").tag(sync=True)


@register
Expand Down Expand Up @@ -548,7 +549,7 @@ class SelectionSlider(_SelectionNonempty):

orientation = CaselessStrEnum(
values=['horizontal', 'vertical'], default_value='horizontal',
allow_none=False, help="Vertical or horizontal.").tag(sync=True)
help="Vertical or horizontal.").tag(sync=True)
readout = Bool(True,
help="Display the current selected label next to the slider").tag(sync=True)
continuous_update = Bool(True,
Expand Down Expand Up @@ -597,7 +598,7 @@ def _validate_index(self, proposal):

orientation = CaselessStrEnum(
values=['horizontal', 'vertical'], default_value='horizontal',
allow_none=False, help="Vertical or horizontal.").tag(sync=True)
help="Vertical or horizontal.").tag(sync=True)
readout = Bool(True,
help="Display the current selected label next to the slider").tag(sync=True)
continuous_update = Bool(True,
Expand Down

0 comments on commit 945dda6

Please sign in to comment.