MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / vtop

Function vtop

PySimpleGUI/PySimpleGUI.py:13193–13212  ·  view source on GitHub ↗

Align an element or a row of elements to the top of the row that contains it :param elem_or_row: the element or row of elements :type elem_or_row: Element | List[Element] | Tuple[Element] :param expand_x: If True/False the value will be passed to the Column Eleme

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

Source from the content-addressed store, hash-verified

13191
13192
13193def vtop(elem_or_row, expand_x=None, expand_y=None, background_color=None):
13194 """
13195 Align an element or a row of elements to the top of the row that contains it
13196
13197 :param elem_or_row: the element or row of elements
13198 :type elem_or_row: Element | List[Element] | Tuple[Element]
13199 :param expand_x: If True/False the value will be passed to the Column Elements used to make this feature
13200 :type expand_x: (bool)
13201 :param expand_y: If True/False the value will be passed to the Column Elements used to make this feature
13202 :type expand_y: (bool)
13203 :param background_color: Background color for container that is used by vtop to do the alignment
13204 :type background_color: str | None
13205 :return: A column element containing the provided element aligned to the top or list of elements (a row)
13206 :rtype: Column | List[Column]
13207 """
13208
13209 if isinstance(elem_or_row, list) or isinstance(elem_or_row, tuple):
13210 return [Column([[e]], pad=(0, 0), vertical_alignment='top', expand_x=expand_x, expand_y=expand_y, background_color=background_color) for e in elem_or_row]
13211
13212 return Column([[elem_or_row]], pad=(0, 0), vertical_alignment='top', expand_x=expand_x, expand_y=expand_y, background_color=background_color)
13213
13214
13215def vcenter(elem_or_row, expand_x=None, expand_y=None, background_color=None):

Callers 1

_create_main_windowFunction · 0.85

Calls 1

ColumnClass · 0.85

Tested by

no test coverage detected