Add selection widget

This commit is contained in:
Jonathan Frederic 2013-10-17 06:15:59 +00:00
parent c9a44b86cb
commit 1b6062beee
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,2 @@
var SelectionWidgetModel = IPython.WidgetModel.extend({});
IPython.notebook.widget_manager.register_widget_model('SelectionWidgetModel', SelectionWidgetModel);

View File

@ -0,0 +1,15 @@
import os
from ..widget import Widget
from IPython.utils.traitlets import Unicode, List, Bool
from IPython.utils.javascript import display_all_js
class SelectionWidget(Widget):
target_name = Unicode('SelectionWidgetModel')
default_view_name = Unicode('DropdownView')
_keys = ['value', 'values', 'disabled']
value = Unicode()
values = List() # List of values the user can select
disabled = Bool(False) # Enable or disable user changes