notebook/IPython/html/widgets/widget_int.py

31 lines
1.2 KiB
Python
Raw Normal View History

2013-10-26 02:31:48 +08:00
"""IntWidget class.
Represents an unbounded int using a widget.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
2013-11-01 02:15:49 +08:00
from .widget import Widget
2013-10-19 04:38:26 +08:00
from IPython.utils.traitlets import Unicode, Int, Bool, List
2013-10-26 02:31:48 +08:00
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
2013-10-19 04:38:26 +08:00
class IntWidget(Widget):
target_name = Unicode('IntWidgetModel')
default_view_name = Unicode('IntTextView')
2013-10-26 02:31:48 +08:00
# Keys
2013-10-30 00:46:27 +08:00
_keys = ['value', 'disabled', 'description']
2013-10-26 02:31:48 +08:00
value = Int(0, help="Int value")
disabled = Bool(False, help="Enable or disable user changes")
2013-10-30 00:46:27 +08:00
description = Unicode(help="Description of the value this widget represents")