ExpanderLayout (hwx.gui)#

class ExpanderLayout(*childrenList, **kwds)#

Bases: GridLayout

Gridlayout that also manages expanding and collapsing the area containing the widgets that follow and ExpanderButton.

Example

from hwx import gui

displacement = gui.DoubleEdit (9.8, units="length")
velocity     = gui.DoubleEdit (3.2, units="velocity")
expander     = gui.ExpanderButton() # click to show/hide following rows

# "-" symbol inside a ExpanderLayout children denotes a previous column
# stretch in a row.
layout = gui.ExpanderLayout(
border   = 5,     # padding around all children
spacing  = (5,2), # padding around each child (horizontal, vertical)
#spacing  = 2,     # padding around each child
children = (
   ("Displacement", displacement, expander),
   ("Velocity", velocity, "-"), # Here velocity widget is stretched till
                                 # the last column.
),
)

show (layout)