##// END OF EJS Templates
Added boolean widget
Added boolean widget

File last commit:

r14257:20896811
r14259:ef5919e2
Show More
int_range.py
18 lines | 732 B | text/x-python | PythonLexer
Jonathan Frederic
Add int range widget
r14241 import os
Jonathan Frederic
Updated imports to reflect class move
r14250 from base import Widget
Jonathan Frederic
Added system that allows js to be required by widgets.
r14256 from IPython.utils.traitlets import Unicode, Int, Bool, List
Jonathan Frederic
Add int range widget
r14241 from IPython.utils.javascript import display_all_js
class IntRangeWidget(Widget):
target_name = Unicode('IntRangeWidgetModel')
default_view_name = Unicode('IntSliderView')
Jonathan Frederic
Removed require.js scheme since it forces async event driven model,...
r14257 js_requirements = List(["static/notebook/js/widgets/int_range.js"])
Jonathan Frederic
Add int range widget
r14241 _keys = ['value', 'step', 'max', 'min', 'disabled', 'orientation']
value = Int(0)
max = Int(100) # Max value
min = Int(0) # Min value
disabled = Bool(False) # Enable or disable user changes
step = Int(1) # Minimum step that the value can take (ignored by some views)
orientation = Unicode(u'horizontal') # Vertical or horizontal (ignored by some views)