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
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-01-07 20:04:24 +08:00
|
|
|
from .widget import DOMWidget
|
2014-01-16 19:42:38 +08:00
|
|
|
from IPython.utils.traitlets import Unicode, CInt, Bool, List
|
2013-10-19 04:38:26 +08:00
|
|
|
|
2013-10-26 02:31:48 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Classes
|
|
|
|
#-----------------------------------------------------------------------------
|
2014-01-15 00:24:35 +08:00
|
|
|
class IntTextWidget(DOMWidget):
|
2014-01-14 23:21:35 +08:00
|
|
|
view_name = Unicode('IntTextView', sync=True)
|
2013-10-19 04:38:26 +08:00
|
|
|
|
2013-10-26 02:31:48 +08:00
|
|
|
# Keys
|
2014-01-16 19:42:38 +08:00
|
|
|
value = CInt(0, help="Int value", sync=True)
|
2014-01-14 23:15:19 +08:00
|
|
|
disabled = Bool(False, help="Enable or disable user changes", sync=True)
|
|
|
|
description = Unicode(help="Description of the value this widget represents", sync=True)
|