From 8195c68aa7aa66284593d489978950aac0f3ddb9 2014-01-16 10:56:00 From: Jonathan Frederic Date: 2014-01-16 10:56:00 Subject: [PATCH] Added float widget --- diff --git a/IPython/html/static/notebook/js/widgets/float.js b/IPython/html/static/notebook/js/widgets/float.js new file mode 100644 index 0000000..a793d2a --- /dev/null +++ b/IPython/html/static/notebook/js/widgets/float.js @@ -0,0 +1,4 @@ +require(["notebook/js/widget"], function(){ + var FloatWidgetModel = IPython.WidgetModel.extend({}); + IPython.notebook.widget_manager.register_widget_model('FloatWidgetModel', FloatWidgetModel); +}); \ No newline at end of file diff --git a/IPython/html/widgets/__init__.py b/IPython/html/widgets/__init__.py index 6275003..101a43a 100644 --- a/IPython/html/widgets/__init__.py +++ b/IPython/html/widgets/__init__.py @@ -2,6 +2,7 @@ from base import Widget, init_widget_js from bool import BoolWidget from container import ContainerWidget +from float import FloatWidget from float_range import FloatRangeWidget from int_range import IntRangeWidget from selection import SelectionWidget diff --git a/IPython/html/widgets/float.py b/IPython/html/widgets/float.py new file mode 100644 index 0000000..42daf30 --- /dev/null +++ b/IPython/html/widgets/float.py @@ -0,0 +1,10 @@ +from base import Widget +from IPython.utils.traitlets import Unicode, Float, Bool, List + +class FloatWidget(Widget): + target_name = Unicode('FloatWidgetModel') + default_view_name = Unicode('FloatTextView') + _keys = ['value', 'disabled'] + + value = Float(0.0) + disabled = Bool(False) # Enable or disable user changes