Added int widget

This commit is contained in:
Jonathan Frederic 2013-10-18 20:38:26 +00:00
parent 26f31184e7
commit f3a3e7c9cb
3 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,4 @@
require(["notebook/js/widget"], function(){
var IntWidgetModel = IPython.WidgetModel.extend({});
IPython.notebook.widget_manager.register_widget_model('IntWidgetModel', IntWidgetModel);
});

View File

@ -4,6 +4,7 @@ from bool import BoolWidget
from container import ContainerWidget
from float import FloatWidget
from float_range import FloatRangeWidget
from int import IntWidget
from int_range import IntRangeWidget
from selection import SelectionWidget
from string import StringWidget

View File

@ -0,0 +1,10 @@
from base import Widget
from IPython.utils.traitlets import Unicode, Int, Bool, List
class IntWidget(Widget):
target_name = Unicode('IntWidgetModel')
default_view_name = Unicode('IntTextView')
_keys = ['value', 'disabled']
value = Int(0)
disabled = Bool(False) # Enable or disable user changes