Web Analytics Made Easy - Statcounter
Skip to content

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,
    frame_color = None,
    relief = "groove",
    element_justification = "float",
    size = (None, None),
    font = None,
    pad = None,
    border_width = None,
    key = None,
    k = None,
    tooltip = None,
    visible = True,
    size_px = (None, None),
    metadata = None
)

Parameter Descriptions

Name Type Default Description
background_color str None background color of the Frame
border_width int None width of border around element in pixels
element_justification str float 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
frame_color str None color of the frame lines
k str or int or tuple or object None Same as the Key. You can use either k or key. Which ever is set will be used.
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
metadata Any None User metadata that can be set to ANYTHING
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),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 groove 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 the title text
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
visible bool True set visibility state of the element

Class Properties

This class has no public properties

Class Methods

 def add_row
 def expand
 def get_stylesheet
 def layout
 def set_stylesheet
 def update

add_row

Not recommended user call. Used to add rows of Elements to the Frame Element.

add_row(
    args = *<1 or N objects>
)

Parameter Descriptions

Name Type Default Description
*args List[Element] The list of elements for this row

expand

WARNING - NOT USED IN PySimpleGUIQt port. Provided as dummy method

expand(
    expand_x = False,
    expand_y = False,
    expand_row = True
)

Parameter Descriptions

Name Type Default Description
expand_row bool True If True the row containing the element will also expand. Without this your element is "trapped" within the row
expand_x bool False If True Element will expand in the Horizontal directions
expand_y bool False If True Element will expand in the Vertical directions
RETURN None None

get_stylesheet

Returns the stylesheet for element's associated Qt Widget

get_stylesheet()

Parameter Descriptions

Name Type Default Description
RETURN str stylesheet

layout

Can use like the Window.Layout method, but it's better to use the layout parameter when creating

layout(
    rows
)

Parameter Descriptions

Name Type Default Description
rows List[List[Element]] The rows of Elements

set_stylesheet

Sets the stylesheet for a Qt Widget

set_stylesheet(
    stylesheet
)

Parameter Descriptions

Name Type Default Description
stylesheet str Stylesheet (string) to set stylesheet to

update

Changes some of the settings for the Graph Element. Must call Window.Read or Window.Finalize prior

Changes will not be visible in your window until you call window.read or window.refresh.

If you change visibility, your element may MOVE.

update(
    visible = None
)

Parameter Descriptions

Name Type Default Description
visible bool None set visibility state of the element (Default = True)