Hbox Spacing Example

An example of the hbox layout helper with inter-element spacing.

This example is nearly identical to the hbox.enaml example. However, this time we change the default inter-element spacing from 10 to 30.

Tip

To see this example in action, download it from hbox_spacing and run:

$ enaml-run hbox_spacing.enaml

Screenshot

../_images/ex_hbox_spacing.png

Example Enaml Code

#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#------------------------------------------------------------------------------
""" An example of the `hbox` layout helper with inter-element spacing.

This example is nearly identical to the `hbox.enaml` example. However,
this time we change the default inter-element spacing from 10 to 30.

<< autodoc-me >>
"""
from enaml.layout.api import hbox
from enaml.widgets.api import Window, Container, PushButton


enamldef Main(Window):
    Container:
        constraints = [
            hbox(pb1, pb2, pb3, spacing=30)
        ]
        PushButton: pb1:
            text = 'Spam'
        PushButton: pb2:
            text = 'Long Name Foo'
        PushButton: pb3:
            text = 'Bar'