Web Analytics Made Easy - Statcounter
Skip to content

Layout Helper Funcs

pin

Pin's an element provided into a layout so that when it's made invisible and visible again, it will be in the correct place. Otherwise it will be placed at the end of its containing window/column.

The element you want to pin is the element that you'll be making visibile/invisible.

The pin helper function also causes containers to shrink to fit the contents correct after something inside has changed visiblity. Note that setting a hardcoded size on your window can impact this ability to shrink.

pin(
    elem,
    vertical_alignment = None,
    shrink = True,
    expand_x = None,
    expand_y = None
)

Parameter Descriptions

Name Type Default Description
elem Element the element to put into the layout
expand_x bool None If True/False the value will be passed to the Column Elements used to make this feature
expand_y bool None If True/False the value will be passed to the Column Elements used to make this feature
shrink bool True If True, then the space will shrink down to a single pixel when hidden. False leaves the area large and blank
vertical_alignment str or None None Aligns elements vertically. 'top', 'center', 'bottom'. Can be shortened to 't', 'c', 'b'
RETURN Column A column element containing the provided element

Push

Acts like a Stretch element found in the Qt port. Used in a Horizontal fashion. Placing one on each side of an element will enter the element. Place one to the left and the element to the right will be right justified. See VStretch for vertical type

Push(
    background_color = None
)

Parameter Descriptions

Name Type Default Description
background_color str None color of background may be needed because of how this is implemented

VPush

Acts like a Stretch element found in the Qt port. Used in a Vertical fashion.

VPush(
    background_color = None
)

Parameter Descriptions

Name Type Default Description
background_color str None color of background may be needed because of how this is implemented

Stretch

This method is an alias for Push

VStretch

This method is an alias for VPush

vbottom

Align an element or a row of elements to the bottom of the row that contains it

vbottom(
    elem_or_row,
    expand_x = None,
    expand_y = None,
    background_color = None
)

Parameter Descriptions

Name Type Default Description
background_color str or None None Background color for container that is used by vcenter to do the alignment
elem_or_row Element or List[Element] or Tuple[Element] the element or row of elements
expand_x bool None If True/False the value will be passed to the Column Elements used to make this feature
expand_y bool None If True/False the value will be passed to the Column Elements used to make this feature
RETURN Column or List[Column] A column element containing the provided element aligned to the bottom or list of elements (a row)

vcenter

Align an element or a row of elements to the center of the row that contains it

vcenter(
    elem_or_row,
    expand_x = None,
    expand_y = None,
    background_color = None
)

Parameter Descriptions

Name Type Default Description
background_color str or None None Background color for container that is used by vcenter to do the alignment
elem_or_row Element or List[Element] or Tuple[Element] the element or row of elements
expand_x bool None If True/False the value will be passed to the Column Elements used to make this feature
expand_y bool None If True/False the value will be passed to the Column Elements used to make this feature
RETURN Column or List[Column] A column element containing the provided element aligned to the center or list of elements (a row)

vtop

Align an element or a row of elements to the top of the row that contains it

vtop(
    elem_or_row,
    expand_x = None,
    expand_y = None,
    background_color = None
)

Parameter Descriptions

Name Type Default Description
background_color str or None None Background color for container that is used by vtop to do the alignment
elem_or_row Element or List[Element] or Tuple[Element] the element or row of elements
expand_x bool None If True/False the value will be passed to the Column Elements used to make this feature
expand_y bool None If True/False the value will be passed to the Column Elements used to make this feature
RETURN Column or List[Column] A column element containing the provided element aligned to the top or list of elements (a row)