notebook/IPython/html/widgets/widget_container.py
Jonathan Frederic e619bdf313 Flex box system improvements
Now to set a container to vbox or hbox you call .vbox() or .hbox()
2014-01-16 10:56:00 +00:00

43 lines
1.1 KiB
Python

from base import Widget
from IPython.utils.traitlets import Unicode, Bool
class ContainerWidget(Widget):
target_name = Unicode('container_widget')
default_view_name = Unicode('ContainerView')
_keys = ['_vbox', '_hbox', '_start', '_end', '_center']
_trait_changing = False
_hbox = Bool(False)
_vbox = Bool(False)
_start = Bool(False)
_end = Bool(False)
_center = Bool(False)
def hbox(self, enabled=True):
self._hbox = enabled
if enabled:
self._vbox = False
def vbox(self, enabled=True):
self._vbox = enabled
if enabled:
self._hbox = False
def start(self, enabled=True):
self._start = enabled
if enabled:
self._end = False
self._center = False
def end(self, enabled=True):
self._end = enabled
if enabled:
self._start = False
self._center = False
def center(self, enabled=True):
self._center = enabled
if enabled:
self._start = False
self._end = False