Frame
A Frame Element that contains other Elements. Encloses with a line around elements and a text label.
Frame(
title,
layout,
title_color = None,
background_color = None,
title_location = None,
element_justification = "left",
relief = 0,
size = (None, None),
size_px = (None, None),
font = None,
pad = None,
border_width = None,
key = None,
tooltip = None
)
Parameter Descriptions
Name | Type | Default | Description |
---|---|---|---|
background_color | str | None | color of background. Can be in #RRGGBB format or a color name "black" |
border_width | int | None | width of border around element in pixels |
element_justification | str | left | All elements inside the Frame will have this justification 'left', 'right', 'center' are valid values |
font | (str or (str, int[, str]) or None) | None | specifies the font family, size, etc. for the TITLE. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
key | str or int or tuple or object | None | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
layout | List[List[Elements]] | The layout to put inside the Frame | |
pad | (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | None | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
relief | enum | 0 | relief style. Values are same as other elements with reliefs. Choices include RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
size | (int, int) | (None, None) | (width, height) Sets an initial hard-coded size for the Frame. This used to be a problem, but was fixed in 4.53.0 and works better than Columns when using the size paramter |
size_px | (int, int) or (None, None) | (None, None) | w=pixels-wide, h=pixels-high |
title | str | text that is displayed as the Frame's "label" or title | |
title_color | str | None | color of title text. Can be in #RRGGBB format or a color name "black" |
title_location | enum | None | location to place the text title. Choices include: TITLE_LOCATION_TOP TITLE_LOCATION_BOTTOM TITLE_LOCATION_LEFT TITLE_LOCATION_RIGHT TITLE_LOCATION_TOP_LEFT TITLE_LOCATION_TOP_RIGHT TITLE_LOCATION_BOTTOM_LEFT TITLE_LOCATION_BOTTOM_RIGHT |
tooltip | str | None | text, that will appear when mouse hovers over the element |
Class Properties
This class has no public properties
Class Methods
def update
update
Updates the element
update(
widget,
background_color = None,
text_color = None,
font = None,
visible = None,
disabled = None,
tooltip = None
)
Parameter Descriptions
Name | Type | Default | Description |
---|---|---|---|
background_color | None | Widget background color | |
disabled | bool | None | Is the element disabled |
font | None | Text font | |
text_color | None | Text color | |
tooltip | None | Tooltip to be shown | |
visible | bool | None | Is the element visible |
widget | The widget to be updated |