mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Added int widget
This commit is contained in:
parent
26f31184e7
commit
f3a3e7c9cb
4
IPython/html/static/notebook/js/widgets/int.js
Normal file
4
IPython/html/static/notebook/js/widgets/int.js
Normal file
@ -0,0 +1,4 @@
|
||||
require(["notebook/js/widget"], function(){
|
||||
var IntWidgetModel = IPython.WidgetModel.extend({});
|
||||
IPython.notebook.widget_manager.register_widget_model('IntWidgetModel', IntWidgetModel);
|
||||
});
|
@ -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
|
||||
|
10
IPython/html/widgets/int.py
Normal file
10
IPython/html/widgets/int.py
Normal 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
|
Loading…
Reference in New Issue
Block a user