GridLayout (hwx.gui)#

class GridLayout(*childrenList, **kwds)#

Bases: Layout

Layout widgets in rows and columns.

Method Table#



addChildren (self, children, nrows=None, ncols=None)

Add the children in the grid layout.


from hwx import gui

displacement = gui.DoubleEdit (9.8, units="length")
velocity     = gui.DoubleEdit (3.2, units="velocity")

layout = gui.GridLayout(
border   = 5,     # padding around all children
spacing  = (5,2), # padding around each child (horizontal, vertical)
#spacing  = 2,     # padding around each child
children = (
   ("Displacement", displacement),
   ("Velocity",     velocity),

show (layout)
addChildren(children, nrows=None, ncols=None)#

Add the children in the grid layout.

  • children (list[Widget]) – The items to be added in the layout.

  • nrows (int) – The number of rows in the grid.

  • ncols (int) – The number of columns in the grid.