ELEMENT AND FUNCTION CALL REFERENCE

Here you will find the details for all Elements, Objects, and Functions that are available to you. If you want to use a complex element and don't understand the parameters, then this is the right place to come. For every element you're shown the parameters used to create it as well as all methods available to call.

Currently PySimpleGUI (tkinter) only

This documentation is created using the PySimpleGUI.py file which means it's based on the tkinter code. Some of the calls are different, might not exist at all, or there may be more methods/functions for the other PySimpleGUI ports (Qt, Wx, Web).

Work is underway to get the PySimpleGUIQt docstrings completed and corrected.

Caution - Some functions / methods may be internal only yet exposed in this documentation

This section of the documentation is generated directly from the source code. As a result, sometimes internal only functions or methods that you are not supposed to be calling are accidently shown in this documentation. Hopefully these accidents don't happen often.

Here are all of the Elements, the Window & SystemTray classes, and all functions

Button Element

Button Element - Defines all possible buttons. The shortcuts such as Submit, FileBrowse, ... each create a Button

You should NOT be setting this directly. ONLY the shortcut functions set this

Union[str, Tuple[int, int]]

target

key or (row,col) target for the button. Note that -1 for column means 1 element to the left of this one. The constant ThisRow is used to indicate the current row. The Button itself is a valid target for some types of button

str

tooltip

text, that will appear when mouse hovers over the element

Tuple[Tuple[str, str], ...]

file_types

the filetypes that will be used to match files. To indicate all files: (("ALL Files", "."),). Note - NOT SUPPORTED ON MAC

str

initial_folder

starting path for folders and files

bool

disabled

If True button will be created disabled

bool

click_submits

DO NOT USE. Only listed for backwards compat - Use enable_events instead

bool

enable_events

Turns on the element specific events. If this button is a target, should it generate an event when filled in

str

image_filename

image filename if there is a button image. GIFs and PNGs only.

Union[bytes, str]

image_data

Raw or Base64 representation of the image to put on button. Choose either filename or data

Tuple[int, int]

image_size

Size of the image in pixels (width, height)

int

image_subsample

amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc

int

border_width

width of border around button in pixels

Tuple[int, int]

size

(width, height) of the button in characters wide, rows high

bool

auto_size_button

if True the button size is sized to fit the text

Tuple[str, str]

button_color

(text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green".

Tuple[str, str]

disabled_button_color

colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color

bool

use_ttk_buttons

True = use ttk buttons. False = do not use ttk buttons. None (Default) = use ttk buttons only if on a Mac and not with button images

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

bool

bind_return_key

If True the return key will cause this button to be pressed

bool

focus

if True, initial focus will be put on this button

(int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int)

(text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"

bool

disabled

disable or enable state of the element

Union[bytes, str]

image_data

Raw or Base64 representation of the image to put on button. Choose either filename or data

str

image_filename

image filename if there is a button image. GIFs and PNGs only.

Tuple[str, str]

disabled_button_color

colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color

bool

visible

control visibility of element

int

image_subsample

amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc

Tuple[int, int]

image_size

Size of the image in pixels (width, height)

bind

Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event

bind(bind_string, key_modifier)

click

Generates a click of the button as if the user clicked the button
Calls the tkinter invoke method for the button

click()

expand

Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions

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

get_size

Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.

get_size()

Type

Name

Meaning

return

width and height of the element

get_text

Returns the current text shown on a button

get_text()

Type

Name

Meaning

return

The text currently displayed on the button

hide_row

Hide the entire row an Element is located on.
Use this if you must have all space removed when you are hiding an element, including the row container

hide_row()

set_cursor

Sets the cursor for the current Element.

set_cursor(cursor)

set_focus

Sets the current focus to be on this element

set_focus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

set_size

Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.

set_size(size=(None, None))

Parameter Descriptions:

Type

Name

Meaning

Tuple[int, int]

size

The size in characters, rows typically. In some cases they are pixels

set_tooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

set_tooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

unbind

Removes a previously bound tkinter event from an Element.

unbind(bind_string)

unhide_row

Unhides (makes visible again) the row container that the Element is located on.
Note that it will re-appear at the bottom of the window / container, most likely.

unhide_row()

update

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

(text color, background color) of button. Easy to remember which is which if you say "ON" between colors. "red" on "green"

bool

disabled

disable or enable state of the element

Union[bytes, str]

image_data

Raw or Base64 representation of the image to put on button. Choose either filename or data

str

image_filename

image filename if there is a button image. GIFs and PNGs only.

Tuple[str, str]

disabled_button_color

colors to use when button is disabled (text, background). Use None for a color if don't want to change. Only ttk buttons support both text and background colors. tk buttons only support changing text color

bool

visible

control visibility of element

int

image_subsample

amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc

Tuple[int, int]

image_size

Size of the image in pixels (width, height)

ButtonMenu Element

The Button Menu Element. Creates a button that when clicked will show a menu similar to right click menu

SetFocus

SetTooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

SetTooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

Update

Changes some of the settings for the Checkbox Element. Must call Window.Read or Window.Finalize prior.
Note that changing visibility may cause element to change locations when made visible after invisible

bind

Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event

bind(bind_string, key_modifier)

expand

Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions

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

get

Return the current state of this checkbox

get()

Type

Name

Meaning

return

Current state of checkbox

get_size

Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.

get_size()

Type

Name

Meaning

return

width and height of the element

hide_row

Hide the entire row an Element is located on.
Use this if you must have all space removed when you are hiding an element, including the row container

hide_row()

set_cursor

Sets the cursor for the current Element.

set_cursor(cursor)

set_focus

Sets the current focus to be on this element

set_focus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

set_size

Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.

set_size(size=(None, None))

Parameter Descriptions:

Type

Name

Meaning

Tuple[int, int]

size

The size in characters, rows typically. In some cases they are pixels

set_tooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

set_tooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

unbind

Removes a previously bound tkinter event from an Element.

unbind(bind_string)

unhide_row

Unhides (makes visible again) the row container that the Element is located on.
Note that it will re-appear at the bottom of the window / container, most likely.

unhide_row()

update

Changes some of the settings for the Checkbox Element. Must call Window.Read or Window.Finalize prior.
Note that changing visibility may cause element to change locations when made visible after invisible

values to choose. While displayed as text, the items returned are what the caller supplied, not text

Any

default_value

Choice to be displayed as initial value. Must match one of values variable contents

Tuple[int, int] (width, height)

size

width = characters-wide, height = rows-high

bool

auto_size_text

True if element should be the same size as the contents

str

background_color

color of background

str

text_color

color of the text

bool

change_submits

DEPRICATED DO NOT USE. Use enable_events instead

bool

enable_events

Turns on the element specific events. Combo event is when a choice is made

bool

disabled

set disable state for element

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

bool

visible

set visibility state of the element

Any

metadata

User metadata that can be set to ANYTHING

Get

Returns the current (right now) value of the Combo. DO NOT USE THIS AS THE NORMAL WAY OF READING A COMBO!
You should be using values from your call to window.Read instead. Know what you're doing if you use it.

Get()

Type

Name

Meaning

return

Returns the value of what is currently chosen

SetFocus

Sets the current focus to be on this element

SetFocus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

SetTooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

SetTooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

Update

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

change which value is current selected hased on new list of previous list of choices

List[Any]

values

change list of choices

int

set_to_index

change selection to a particular choice starting with index = 0

bool

disabled

disable or enable state of the element

bool

readonly

if True make element readonly (user cannot change any choices)

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

bool

visible

control visibility of element

bind

Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event

bind(bind_string, key_modifier)

expand

Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions

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

get

Returns the current (right now) value of the Combo. DO NOT USE THIS AS THE NORMAL WAY OF READING A COMBO!
You should be using values from your call to window.Read instead. Know what you're doing if you use it.

get()

Type

Name

Meaning

return

Returns the value of what is currently chosen

get_size

Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.

get_size()

Type

Name

Meaning

return

width and height of the element

hide_row

Hide the entire row an Element is located on.
Use this if you must have all space removed when you are hiding an element, including the row container

hide_row()

set_cursor

Sets the cursor for the current Element.

set_cursor(cursor)

set_focus

Sets the current focus to be on this element

set_focus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

set_size

Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.

set_size(size=(None, None))

Parameter Descriptions:

Type

Name

Meaning

Tuple[int, int]

size

The size in characters, rows typically. In some cases they are pixels

set_tooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

set_tooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

unbind

Removes a previously bound tkinter event from an Element.

unbind(bind_string)

unhide_row

Unhides (makes visible again) the row container that the Element is located on.
Note that it will re-appear at the bottom of the window / container, most likely.

unhide_row()

update

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

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

str

tooltip

text, that will appear when mouse hovers over the element

List[List[Union[List[str],str]]]

right_click_menu

A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.

bool

visible

set visibility state of the element

str

element_justification

All elements inside the Frame will have this justification 'left', 'right', 'center' are valid values

Any

metadata

User metadata that can be set to ANYTHING

AddRow

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

AddRow(args=*<1 or N object>)

Parameter Descriptions:

Type

Name

Meaning

List[Element]

*args

The list of elements for this row

Layout

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

Layout(rows)

Parameter Descriptions:

Type

Name

Meaning

List[List[Element]]

rows

The rows of Elements

(Frame)

RETURN

Used for chaining

SetFocus

Sets the current focus to be on this element

SetFocus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

SetTooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

SetTooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

Update

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

Update(value=None, visible=None)

Parameter Descriptions:

Type

Name

Meaning

Any

value

New text value to show on frame

bool

visible

control visibility of element

add_row

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

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

Parameter Descriptions:

Type

Name

Meaning

List[Element]

*args

The list of elements for this row

bind

Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event

bind(bind_string, key_modifier)

expand

Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions

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

get_size

Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.

get_size()

Type

Name

Meaning

return

width and height of the element

hide_row

Hide the entire row an Element is located on.
Use this if you must have all space removed when you are hiding an element, including the row container

hide_row()

layout

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

layout(rows)

Parameter Descriptions:

Type

Name

Meaning

List[List[Element]]

rows

The rows of Elements

(Frame)

RETURN

Used for chaining

set_cursor

Sets the cursor for the current Element.

set_cursor(cursor)

set_focus

Sets the current focus to be on this element

set_focus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

set_size

Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.

set_size(size=(None, None))

Parameter Descriptions:

Type

Name

Meaning

Tuple[int, int]

size

The size in characters, rows typically. In some cases they are pixels

set_tooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

set_tooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

unbind

Removes a previously bound tkinter event from an Element.

unbind(bind_string)

unhide_row

Unhides (makes visible again) the row container that the Element is located on.
Note that it will re-appear at the bottom of the window / container, most likely.

unhide_row()

update

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

update(value=None, visible=None)

Parameter Descriptions:

Type

Name

Meaning

Any

value

New text value to show on frame

bool

visible

control visibility of element

Graph Element

Creates an area for you to draw on. The MAGICAL property this Element has is that you interact
with the element using your own coordinate system. This is an important point!! YOU define where the location
is for (0,0). Want (0,0) to be in the middle of the graph like a math 4-quadrant graph? No problem! Set your
lower left corner to be (-100,-100) and your upper right to be (100,100) and you've got yourself a graph with
(0,0) at the center.
One of THE coolest of the Elements.
You can also use float values. To do so, be sure and set the float_values parameter.
Mouse click and drag events are possible and return the (x,y) coordinates of the mouse
Drawing primitives return an "id" that is referenced when you want to operation on that item (e.g. to erase it)

Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element

str

tooltip

text, that will appear when mouse hovers over the element

List[List[Union[List[str],str]]]

right_click_menu

A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.

bool

visible

set visibility state of the element

bool

enable_events

Turns on the element specific events. For an Image element, the event is "image clicked"

Any

metadata

User metadata that can be set to ANYTHING

SetFocus

Sets the current focus to be on this element

SetFocus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

SetTooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

SetTooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

Update

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

Update(filename=None,
data=None,
size=(None, None),
visible=None)

Parameter Descriptions:

Type

Name

Meaning

str

filename

filename to the new image to display.

Union[str, tkPhotoImage]

data

Base64 encoded string OR a tk.PhotoImage object

Tuple[int,int]

size

size of a image (w,h) w=characters-wide, h=rows-high

bool

visible

control visibility of element

UpdateAnimation

Show an Animated GIF. Call the function as often as you like. The function will determine when to show the next frame and will automatically advance to the next frame at the right time.
NOTE - does NOT perform a sleep call to delay

UpdateAnimation(source, time_between_frames=0)

Parameter Descriptions:

Type

Name

Meaning

Union[str,bytes]

source

Filename or Base64 encoded string containing Animated GIF

int

time_between_frames

Number of milliseconds to wait between showing frames

bind

Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event

bind(bind_string, key_modifier)

expand

Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions

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

get_size

Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.

get_size()

Type

Name

Meaning

return

width and height of the element

hide_row

Hide the entire row an Element is located on.
Use this if you must have all space removed when you are hiding an element, including the row container

hide_row()

set_cursor

Sets the cursor for the current Element.

set_cursor(cursor)

set_focus

Sets the current focus to be on this element

set_focus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

set_size

Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.

set_size(size=(None, None))

Parameter Descriptions:

Type

Name

Meaning

Tuple[int, int]

size

The size in characters, rows typically. In some cases they are pixels

set_tooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

set_tooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

unbind

Removes a previously bound tkinter event from an Element.

unbind(bind_string)

unhide_row

Unhides (makes visible again) the row container that the Element is located on.
Note that it will re-appear at the bottom of the window / container, most likely.

unhide_row()

update

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

update(filename=None,
data=None,
size=(None, None),
visible=None)

Parameter Descriptions:

Type

Name

Meaning

str

filename

filename to the new image to display.

Union[str, tkPhotoImage]

data

Base64 encoded string OR a tk.PhotoImage object

Tuple[int,int]

size

size of a image (w,h) w=characters-wide, h=rows-high

bool

visible

control visibility of element

update_animation

Show an Animated GIF. Call the function as often as you like. The function will determine when to show the next frame and will automatically advance to the next frame at the right time.
NOTE - does NOT perform a sleep call to delay

update_animation(source, time_between_frames=0)

Parameter Descriptions:

Type

Name

Meaning

Union[str,bytes]

source

Filename or Base64 encoded string containing Animated GIF

int

time_between_frames

Number of milliseconds to wait between showing frames

update_animation_no_buffering

Show an Animated GIF. Call the function as often as you like. The function will determine when to show the next frame and will automatically advance to the next frame at the right time.
NOTE - does NOT perform a sleep call to delay

update_animation_no_buffering(source, time_between_frames=0)

Parameter Descriptions:

Type

Name

Meaning

Union[str,bytes]

source

Filename or Base64 encoded string containing Animated GIF

int

time_between_frames

Number of milliseconds to wait between showing frames

InputText Element

Display a single text input field. Based on the tkinter Widget `Entry`

list of values to display. Can be any type including mixed types as long as they have str method

List[Any]

default_values

which values should be initially selected

[enum]

select_mode

Select modes are used to determine if only 1 item can be selected or multiple and how they can be selected. Valid choices begin with "LISTBOX_SELECT_MODE_" and include: LISTBOX_SELECT_MODE_SINGLE LISTBOX_SELECT_MODE_MULTIPLE LISTBOX_SELECT_MODE_BROWSE LISTBOX_SELECT_MODE_EXTENDED

bool

change_submits

DO NOT USE. Only listed for backwards compat - Use enable_events instead

bool

enable_events

Turns on the element specific events. Listbox generates events when an item is clicked

bool

bind_return_key

If True, then the return key will cause a the Listbox to generate an event

Tuple(int, int) (width, height)

size

width = characters-wide, height = rows-high

bool

disabled

set disable state for element

bool

auto_size_text

True if element should be the same size as the contents

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

str

background_color

color of background

str

text_color

color of the text

Any

key

Used with window.FindElement and with return values to uniquely identify this element

(int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int)

highlights the item(s) indicated. If parm is an int one entry will be set. If is a list, then each entry in list is highlighted

int

scroll_to_index

scroll the listbox so that this index is the first shown

str

mode

changes the select mode according to tkinter's listbox widget

bool

visible

control visibility of element

Menu Element

Menu Element is the Element that provides a Menu Bar that goes across the top of the window, just below titlebar.
Here is an example layout. The "&" are shortcut keys ALT+key.
Is a List of - "Item String" + List
Where Item String is what will be displayed on the Menubar itself.
The List that follows the item represents the items that are shown then Menu item is clicked
Notice how an "entry" in a mennu can be a list which means it branches out and shows another menu, etc. (resursive)
menu_def = [['&File', ['!&Open', '&Save::savekey', '---', '&Properties', 'E&xit']],
['!&Edit', ['!&Paste', ['Special', 'Normal', ], 'Undo'], ],
['&Debugger', ['Popout', 'Launch Debugger']],
['&Toolbar', ['Command &1', 'Command &2', 'Command &3', 'Command &4']],
['&Help', '&About...'], ]
Finally, "keys" can be added to entries so make them unique. The "Save" entry has a key associated with it. You
can see it has a "::" which signifies the beginning of a key. The user will not see the key portion when the
menu is shown. The key portion is returned as part of the event.

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

bool

visible

set visibility state of the element

Any

metadata

User metadata that can be set to ANYTHING

SetFocus

Sets the current focus to be on this element

SetFocus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

SetTooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

SetTooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

Update

Update a menubar - can change the menu definition and visibility. The entire menu has to be specified

Update(menu_definition=None, visible=None)

Parameter Descriptions:

Type

Name

Meaning

List[List[Tuple[str, List[str]]]

menu_definition

???

bool

visible

control visibility of element

bind

Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event

bind(bind_string, key_modifier)

expand

Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions

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

get_size

Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.

get_size()

Type

Name

Meaning

return

width and height of the element

hide_row

Hide the entire row an Element is located on.
Use this if you must have all space removed when you are hiding an element, including the row container

hide_row()

set_cursor

Sets the cursor for the current Element.

set_cursor(cursor)

set_focus

Sets the current focus to be on this element

set_focus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

set_size

Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.

set_size(size=(None, None))

Parameter Descriptions:

Type

Name

Meaning

Tuple[int, int]

size

The size in characters, rows typically. In some cases they are pixels

set_tooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

set_tooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

unbind

Removes a previously bound tkinter event from an Element.

unbind(bind_string)

unhide_row

Unhides (makes visible again) the row container that the Element is located on.
Note that it will re-appear at the bottom of the window / container, most likely.

unhide_row()

update

Update a menubar - can change the menu definition and visibility. The entire menu has to be specified

update(menu_definition=None, visible=None)

Parameter Descriptions:

Type

Name

Meaning

List[List[Tuple[str, List[str]]]

menu_definition

???

bool

visible

control visibility of element

Multiline Element

Multiline Element - Display and/or read multiple lines of text. This is both an input and output element.
Other PySimpleGUI ports have a separate MultilineInput and MultilineOutput elements. May want to split this
one up in the future too.

if True then new value will be added onto the end of the current value. if False then contents will be replaced.

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

str

text_color

color of the text

str

background_color

color of background

bool

visible

set visibility state of the element

bool

autoscroll

if True then contents of element are scrolled down when new text is added to the end

OptionMenu Element

Option Menu is an Element available ONLY on the tkinter port of PySimpleGUI. It's is a widget that is unique
to tkinter. However, it looks much like a ComboBox. Instead of an arrow to click to pull down the list of
choices, another little graphic is shown on the widget to indicate where you click. After clicking to activate,
it looks like a Combo Box that you scroll to select a choice.

SystemTray

A "Simulated System Tray" that duplicates the API calls available to PySimpleGUIWx and PySimpleGUIQt users.
All of the functionality works. The icon is displayed ABOVE the system tray rather than inside of it.

close

Close the system tray window

close()

hide

Hides the icon

hide()

notify

Displays a "notification window", usually in the bottom right corner of your display. Has an icon, a title, and a message
The window will slowly fade in and out if desired. Clicking on the window will cause it to move through the end the current "phase". For example, if the window was fading in and it was clicked, then it would immediately stop fading in and instead be fully visible. It's a way for the user to quickly dismiss the window.

Tab Element

Tab Element is another "Container" element that holds a layout and displays a tab with text. Used with TabGroup only
Tabs are never placed directly into a layout. They are always "Contained" in a TabGroup layout

DEPRICATED - You can only specify themes using set options or when window is created. It's not possible to do it on an element basis

any

key

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

str

tooltip

text, that will appear when mouse hovers over the element

bool

visible

set visibility state of the element

Any

metadata

User metadata that can be set to ANYTHING

FindKeyFromTabName

Searches through the layout to find the key that matches the text on the tab. Implies names should be unique

FindKeyFromTabName(tab_name)

Parameter Descriptions:

Type

Name

Meaning

str

tab_name

name of a tab

Union[key, None]

RETURN

Returns the key or None if no key found

Get

Returns the current value for the Tab Group, which will be the currently selected tab's KEY or the text on
the tab if no key is defined. Returns None if an error occurs.
Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
are using this method correctly?

Get()

Type

Name

Meaning

return

The key of the currently selected tab or the tab's text if it has no key

SetFocus

Sets the current focus to be on this element

SetFocus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

SetTooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

SetTooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

bind

Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event

bind(bind_string, key_modifier)

expand

Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions

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

find_key_from_tab_name

Searches through the layout to find the key that matches the text on the tab. Implies names should be unique

find_key_from_tab_name(tab_name)

Parameter Descriptions:

Type

Name

Meaning

str

tab_name

name of a tab

Union[key, None]

RETURN

Returns the key or None if no key found

get

Returns the current value for the Tab Group, which will be the currently selected tab's KEY or the text on
the tab if no key is defined. Returns None if an error occurs.
Note that this is exactly the same data that would be returned from a call to Window.Read. Are you sure you
are using this method correctly?

get()

Type

Name

Meaning

return

The key of the currently selected tab or the tab's text if it has no key

get_size

Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.

get_size()

Type

Name

Meaning

return

width and height of the element

hide_row

Hide the entire row an Element is located on.
Use this if you must have all space removed when you are hiding an element, including the row container

hide_row()

set_cursor

Sets the cursor for the current Element.

set_cursor(cursor)

set_focus

Sets the current focus to be on this element

set_focus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

set_size

Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.

set_size(size=(None, None))

Parameter Descriptions:

Type

Name

Meaning

Tuple[int, int]

size

The size in characters, rows typically. In some cases they are pixels

set_tooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

set_tooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

unbind

Removes a previously bound tkinter event from an Element.

unbind(bind_string)

unhide_row

Unhides (makes visible again) the row container that the Element is located on.
Note that it will re-appear at the bottom of the window / container, most likely.

Used with window.FindElement and with return values to uniquely identify this element to uniquely identify this element

str

tooltip

text, that will appear when mouse hovers over the element

List[List[Union[List[str],str]]]

right_click_menu

A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.

bool

visible

set visibility state of the element

Any

metadata

User metadata that can be set to ANYTHING

Get

Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were
edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
user when Table was created or Updated.

Get()

Type

Name

Meaning

return

the current table values (for now what was originally provided up updated)

SetFocus

Sets the current focus to be on this element

SetFocus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

SetTooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

SetTooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

Update

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

bind

Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event

bind(bind_string, key_modifier)

expand

Causes the Element to expand to fill available space in the X and Y directions. Can specify which or both directions

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

get

Dummy function for tkinter port. In the Qt port you can read back the values in the table in case they were
edited. Don't know yet how to enable editing of a Tree in tkinter so just returning the values provided by
user when Table was created or Updated.

get()

Type

Name

Meaning

return

the current table values (for now what was originally provided up updated)

get_size

Return the size of an element in Pixels. Care must be taken as some elements use characters to specify their size but will return pixels when calling this get_size method.

get_size()

Type

Name

Meaning

return

width and height of the element

hide_row

Hide the entire row an Element is located on.
Use this if you must have all space removed when you are hiding an element, including the row container

hide_row()

set_cursor

Sets the cursor for the current Element.

set_cursor(cursor)

set_focus

Sets the current focus to be on this element

set_focus(force=False)

Parameter Descriptions:

Type

Name

Meaning

bool

force

if True will call focus_force otherwise calls focus_set

set_size

Changes the size of an element to a specific size.
It's possible to specify None for one of sizes so that only 1 of the element's dimensions are changed.

set_size(size=(None, None))

Parameter Descriptions:

Type

Name

Meaning

Tuple[int, int]

size

The size in characters, rows typically. In some cases they are pixels

set_tooltip

Called by application to change the tooltip text for an Element. Normally invoked using the Element Object such as: window.Element('key').SetToolTip('New tip').

set_tooltip(tooltip_text)

Parameter Descriptions:

Type

Name

Meaning

str

tooltip_text

the text to show in tooltip.

unbind

Removes a previously bound tkinter event from an Element.

unbind(bind_string)

unhide_row

Unhides (makes visible again) the row container that the Element is located on.
Note that it will re-appear at the bottom of the window / container, most likely.

unhide_row()

update

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

The text to display. Can include /n to achieve multiple lines. Will convert (optional) parameter into a string

Tuple[int, int]

size

(width, height) width = characters-wide, height = rows-high

bool

auto_size_text

if True size of the Text Element will be sized to fit the string provided in 'text' parm

bool

click_submits

DO NOT USE. Only listed for backwards compat - Use enable_events instead

bool

enable_events

Turns on the element specific events. Text events happen when the text is clicked

(str/enum)

relief

relief style around the text. Values are same as progress meter relief values. Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

str

text_color

color of the text

str

background_color

color of background

int

border_width

number of pixels for the border (if using a relief)

str

justification

how string should be aligned within space provided by size. Valid choices = left, right, center

(int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int)

TreeData (for Tree Element)

Class that user fills in to represent their tree data. It's a very simple tree representation with a root "Node"
with possibly one or more children "Nodes". Each Node contains a key, text to display, list of values to display
and an icon. The entire tree is built using a single method, Insert. Nothing else is required to make the tree.

Instantiate the object, initializes the Tree Data, creates a root node for you

TreeData()

Insert

Inserts a node into the tree. This is how user builds their tree, by Inserting Nodes
This is the ONLY user callable method in the TreeData class

Insert(parent,
key,
text,
values,
icon=None)

Parameter Descriptions:

Type

Name

Meaning

Node

parent

the parent Node

Any

key

Used to uniquely identify this node

str

text

The text that is displayed at this node's location

List[Any]

values

The list of values that are displayed at this node

Union[str, bytes]

icon

icon

Node

Contains information about the individual node in the tree

Node(parent,
key,
text,
values,
icon=None)

insert

Inserts a node into the tree. This is how user builds their tree, by Inserting Nodes
This is the ONLY user callable method in the TreeData class

insert(parent,
key,
text,
values,
icon=None)

Parameter Descriptions:

Type

Name

Meaning

Node

parent

the parent Node

Any

key

Used to uniquely identify this node

str

text

The text that is displayed at this node's location

List[Any]

values

The list of values that are displayed at this node

Union[str, bytes]

icon

icon

VerticalSeparator Element

Vertical Separator Element draws a vertical line at the given location. It will span 1 "row". Usually paired with
Column Element if extra height is needed

VerticalSeparator(pad=None)

Parameter Descriptions:

Type

Name

Meaning

(int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int)

If true, no titlebar nor frame will be shown on window. This means you cannot minimize the window and it will not show up on the taskbar

bool

grab_anywhere

If True can use mouse to click and drag to move the window. Almost every location of the window will work except input fields on some systems

bool

keep_on_top

If True, window will be created on top of all other windows on screen. It can be bumped down if another window created with this parm

bool

resizable

If True, allows the user to resize the window. Note the not all Elements will change size or location when resizing.

bool

disable_close

If True, the X button in the top right corner of the window will no work. Use with caution and always give a way out toyour users

bool

disable_minimize

if True the user won't be able to minimize window. Good for taking over entire screen and staying that way.

List[List[Union[List[str],str]]]

right_click_menu

A list of lists of Menu items to show when this element is right clicked. See user docs for exact format.

str

transparent_color

Any portion of the window that has this color will be completely transparent. You can even click through these spots to the window under this window.

bool

debugger_enabled

If True then the internal debugger will be enabled

bool

finalize

If True then the Finalize method will be called. Use this rather than chaining .Finalize for cleaner code

str

element_justification

All elements in the Window itself will have this justification 'left', 'right', 'center' are valid values

str

ttk_theme

Set the tkinter ttk "theme" of the window. Default = DEFAULT_TTK_THEME. Sets all ttk widgets to this theme as their default

bool

use_ttk_buttons

Affects all buttons in window. True = use ttk buttons. False = do not use ttk buttons. None = use ttk buttons only if on a Mac

Any

metadata

User metadata that can be set to ANYTHING

AddRow

Adds a single row of elements to a window's self.Rows variables.
Generally speaking this is NOT how users should be building Window layouts.
Users, create a single layout (a list of lists) and pass as a parameter to Window object, or call Window.Layout(layout)

AddRow(args=*<1 or N object>)

AddRows

Loops through a list of lists of elements and adds each row, list, to the layout.
This is NOT the best way to go about creating a window. Sending the entire layout at one time and passing
it as a parameter to the Window call is better.

AddRows(rows)

AlphaChannel

property: AlphaChannel

A property that changes the current alpha channel value (internal value)

Type

Name

Meaning

return

(float) the current alpha channel setting according to self, not read directly from tkinter

BringToFront

Brings this window to the top of all other windows (perhaps may not be brought before a window made to "stay
on top")

BringToFront()

Close

Closes window. Users can safely call even if window has been destroyed. Should always call when done with
a window so that resources are properly freed up within your thread.

Close()

CurrentLocation

Get the current location of the window's top left corner

CurrentLocation()

Type

Name

Meaning

return

The x and y location in tuple form (x,y)

Disable

Disables window from taking any input from the user

Disable()

DisableDebugger

Disable the internal debugger. By default the debugger is ENABLED

DisableDebugger()

Disappear

Causes a window to "disappear" from the screen, but remain on the taskbar. It does this by turning the alpha
channel to 0. NOTE that on some platforms alpha is not supported. The window will remain showing on these
platforms. The Raspberry Pi for example does not have an alpha setting

Disappear()

Elem

Find element object associated with the provided key.
THIS METHOD IS NO LONGER NEEDED to be called by the user

You can perform the same operation by writing this statement:
element = window[key]

You can drop the entire "FindElement" function name and use [ ] instead.

Typically used in combination with a call to element's Update method (or any other element method!):
window[key].Update(new_value)

Versus the "old way"
window.FindElement(key).Update(new_value)

This call can be abbreviated to any of these:
FindElement == Element == Find
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.

Elem(key, silent_on_error=False)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Used with window.FindElement and with return values to uniquely identify this element

bool

silent_on_error

If True do not display popup nor print warning of key errors

Union[Element, Error Element, None]

RETURN

Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;

Element

Find element object associated with the provided key.
THIS METHOD IS NO LONGER NEEDED to be called by the user

You can perform the same operation by writing this statement:
element = window[key]

You can drop the entire "FindElement" function name and use [ ] instead.

Typically used in combination with a call to element's Update method (or any other element method!):
window[key].Update(new_value)

Versus the "old way"
window.FindElement(key).Update(new_value)

This call can be abbreviated to any of these:
FindElement == Element == Find
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.

Element(key, silent_on_error=False)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Used with window.FindElement and with return values to uniquely identify this element

bool

silent_on_error

If True do not display popup nor print warning of key errors

Union[Element, Error Element, None]

RETURN

Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;

Enable

Re-enables window to take user input after having it be Disabled previously

Enable()

EnableDebugger

Enables the internal debugger. By default, the debugger IS enabled

EnableDebugger()

Fill

Fill in elements that are input fields with data based on a 'values dictionary'

Fill(values_dict)

Parameter Descriptions:

Type

Name

Meaning

(Dict[Any:Any])

values_dict

{Element key : value} pairs

(Window)

RETURN

returns self so can be chained with other methods

Finalize

Use this method to cause your layout to built into a real tkinter window. In reality this method is like
Read(timeout=0). It doesn't block and uses your layout to create tkinter widgets to represent the elements.
Lots of action!

Finalize()

Type

Name

Meaning

return

Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!)

Find

Find element object associated with the provided key.
THIS METHOD IS NO LONGER NEEDED to be called by the user

You can perform the same operation by writing this statement:
element = window[key]

You can drop the entire "FindElement" function name and use [ ] instead.

Typically used in combination with a call to element's Update method (or any other element method!):
window[key].Update(new_value)

Versus the "old way"
window.FindElement(key).Update(new_value)

This call can be abbreviated to any of these:
FindElement == Element == Find
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.

Find(key, silent_on_error=False)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Used with window.FindElement and with return values to uniquely identify this element

bool

silent_on_error

If True do not display popup nor print warning of key errors

Union[Element, Error Element, None]

RETURN

Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;

FindElement

Find element object associated with the provided key.
THIS METHOD IS NO LONGER NEEDED to be called by the user

You can perform the same operation by writing this statement:
element = window[key]

You can drop the entire "FindElement" function name and use [ ] instead.

Typically used in combination with a call to element's Update method (or any other element method!):
window[key].Update(new_value)

Versus the "old way"
window.FindElement(key).Update(new_value)

This call can be abbreviated to any of these:
FindElement == Element == Find
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.

FindElement(key, silent_on_error=False)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Used with window.FindElement and with return values to uniquely identify this element

bool

silent_on_error

If True do not display popup nor print warning of key errors

Union[Element, Error Element, None]

RETURN

Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;

FindElementWithFocus

Returns the Element that currently has focus as reported by tkinter. If no element is found None is returned!

FindElementWithFocus()

Type

Name

Meaning

return

An Element if one has been found with focus or None if no element found

GetScreenDimensions

Get the screen dimensions. NOTE - you must have a window already open for this to work (blame tkinter not me)

GetScreenDimensions()

Type

Name

Meaning

return

Tuple containing width and height of screen in pixels

GrabAnyWhereOff

Turns off Grab Anywhere functionality AFTER a window has been created. Don't try on a window that's not yet
been Finalized or Read.

GrabAnyWhereOff()

GrabAnyWhereOn

Turns on Grab Anywhere functionality AFTER a window has been created. Don't try on a window that's not yet
been Finalized or Read.

GrabAnyWhereOn()

Hide

Hides the window from the screen and the task bar

Hide()

Layout

Second of two preferred ways of telling a Window what its layout is. The other way is to pass the layout as
a parameter to Window object. The parameter method is the currently preferred method. This call to Layout
has been removed from examples contained in documents and in the Demo Programs. Trying to remove this call
from history and replace with sending as a parameter to Window.

Layout(rows)

Parameter Descriptions:

Type

Name

Meaning

List[List[Elements]]

rows

Your entire layout

(Window)

RETURN

self so that you can chain method calls

LoadFromDisk

Restore values from a previous call to SaveToDisk which saves the returned values dictionary in Pickle format

LoadFromDisk(filename)

Parameter Descriptions:

Type

Name

Meaning

str

filename

Pickle Filename to load

Maximize

Maximize the window. This is done differently on a windows system versus a linux or mac one. For non-Windows
the root attribute '-fullscreen' is set to True. For Windows the "root" state is changed to "zoomed"
The reason for the difference is the title bar is removed in some cases when using fullscreen option

Maximize()

Minimize

Minimize this window to the task bar

Minimize()

Move

Move the upper left corner of this window to the x,y coordinates provided

Move(x, y)

Parameter Descriptions:

Type

Name

Meaning

int

x

x coordinate in pixels

int

y

y coordinate in pixels

Normal

Restore a window to a non-maximized state. Does different things depending on platform. See Maximize for more.

Normal()

Read

THE biggest deal method in the Window class! This is how you get all of your data from your Window.
Pass in a timeout (in milliseconds) to wait for a maximum of timeout milliseconds. Will return timeout_key
if no other GUI events happen first.

Read(timeout=None,
timeout_key="__TIMEOUT__",
close=False)

Parameter Descriptions:

Type

Name

Meaning

int

timeout

Milliseconds to wait until the Read will return IF no other GUI events happen first

Any

timeout_key

The value that will be returned from the call if the timer expired

bool

close

if True the window will be closed prior to returning

Tuple[(Any), Union[Dict[Any:Any]], List[Any], None]

RETURN

(event, values)

Reappear

Causes a window previously made to "Disappear" (using that method). Does this by restoring the alpha channel

Reappear()

Refresh

Refreshes the window by calling tkroot.update(). Can sometimes get away with a refresh instead of a Read.
Use this call when you want something to appear in your Window immediately (as soon as this function is called).
Without this call your changes to a Window will not be visible to the user until the next Read call

Refresh()

Type

Name

Meaning

return

self so that method calls can be easily "chained"

SaveToDisk

Saves the values contained in each of the input areas of the form. Basically saves what would be returned from a call to Read. It takes these results and saves them to disk using pickle.
Note that every element in your layout that is to be saved must have a key assigned to it.

SaveToDisk(filename)

Parameter Descriptions:

Type

Name

Meaning

str

filename

Filename to save the values to in pickled form

SendToBack

Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront

SendToBack()

SetAlpha

Sets the Alpha Channel for a window. Values are between 0 and 1 where 0 is completely transparent

SetAlpha(alpha)

Parameter Descriptions:

Type

Name

Meaning

float

alpha

0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through)

SetIcon

Changes the icon that is shown on the title bar and on the task bar.
NOTE - The file type is IMPORTANT and depends on the OS!
Can pass in:
* filename which must be a .ICO icon file for windows, PNG file for Linux
* bytes object
* BASE64 encoded file held in a variable

SetIcon(icon=None, pngbase64=None)

Parameter Descriptions:

Type

Name

Meaning

str

icon

Filename or bytes object

str

pngbase64

Base64 encoded image

SetTransparentColor

Set the color that will be transparent in your window. Areas with this color will be SEE THROUGH.

SetTransparentColor(color)

Parameter Descriptions:

Type

Name

Meaning

str

color

Color string that defines the transparent color

Size

property: Size

Return the current size of the window in pixels

Type

Name

Meaning

return

(width, height) of the window

UnHide

Used to bring back a window that was previously hidden using the Hide method

UnHide()

VisibilityChanged

This is a completely dummy method that does nothing. It is here so that PySimpleGUIQt programs can make this
call and then have that same source run on plain PySimpleGUI.

VisibilityChanged()

Type

Name

Meaning

return

add_row

Adds a single row of elements to a window's self.Rows variables.
Generally speaking this is NOT how users should be building Window layouts.
Users, create a single layout (a list of lists) and pass as a parameter to Window object, or call Window.Layout(layout)

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

add_rows

Loops through a list of lists of elements and adds each row, list, to the layout.
This is NOT the best way to go about creating a window. Sending the entire layout at one time and passing
it as a parameter to the Window call is better.

add_rows(rows)

alpha_channel

property: alpha_channel

A property that changes the current alpha channel value (internal value)

Type

Name

Meaning

return

(float) the current alpha channel setting according to self, not read directly from tkinter

bind

Used to add tkinter events to a Window.
The tkinter specific data is in the Window's member variable user_bind_event

bind(bind_string, key)

Parameter Descriptions:

Type

Name

Meaning

str

bind_string

The string tkinter expected in its bind function

Any

key

The event that will be generated when the tkinter event occurs

bring_to_front

Brings this window to the top of all other windows (perhaps may not be brought before a window made to "stay
on top")

bring_to_front()

close

Closes window. Users can safely call even if window has been destroyed. Should always call when done with
a window so that resources are properly freed up within your thread.

close()

current_location

Get the current location of the window's top left corner

current_location()

Type

Name

Meaning

return

The x and y location in tuple form (x,y)

disable

Disables window from taking any input from the user

disable()

disable_debugger

Disable the internal debugger. By default the debugger is ENABLED

disable_debugger()

disappear

Causes a window to "disappear" from the screen, but remain on the taskbar. It does this by turning the alpha
channel to 0. NOTE that on some platforms alpha is not supported. The window will remain showing on these
platforms. The Raspberry Pi for example does not have an alpha setting

disappear()

elem

Find element object associated with the provided key.
THIS METHOD IS NO LONGER NEEDED to be called by the user

You can perform the same operation by writing this statement:
element = window[key]

You can drop the entire "FindElement" function name and use [ ] instead.

Typically used in combination with a call to element's Update method (or any other element method!):
window[key].Update(new_value)

Versus the "old way"
window.FindElement(key).Update(new_value)

This call can be abbreviated to any of these:
FindElement == Element == Find
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.

elem(key, silent_on_error=False)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Used with window.FindElement and with return values to uniquely identify this element

bool

silent_on_error

If True do not display popup nor print warning of key errors

Union[Element, Error Element, None]

RETURN

Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;

element

Find element object associated with the provided key.
THIS METHOD IS NO LONGER NEEDED to be called by the user

You can perform the same operation by writing this statement:
element = window[key]

You can drop the entire "FindElement" function name and use [ ] instead.

Typically used in combination with a call to element's Update method (or any other element method!):
window[key].Update(new_value)

Versus the "old way"
window.FindElement(key).Update(new_value)

This call can be abbreviated to any of these:
FindElement == Element == Find
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.

element(key, silent_on_error=False)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Used with window.FindElement and with return values to uniquely identify this element

bool

silent_on_error

If True do not display popup nor print warning of key errors

Union[Element, Error Element, None]

RETURN

Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;

element_list

Returns a list of all elements in the window

element_list()

Type

Name

Meaning

return

List of all elements in the window and container elements in the window

enable

Re-enables window to take user input after having it be Disabled previously

enable()

enable_debugger

Enables the internal debugger. By default, the debugger IS enabled

enable_debugger()

extend_layout

Adds new rows to an existing container element inside of this window

extend_layout(container, rows)

Parameter Descriptions:

Type

Name

Meaning

(Union[Frame, Column, Tab])

container

(Union[Frame, Column, Tab]) - The container Element the layout will be placed inside of

(List[List[Element]])

rows

(List[List[Element]]) - The layout to be added

(Window)

RETURN

(Window) self so could be chained

fill

Fill in elements that are input fields with data based on a 'values dictionary'

fill(values_dict)

Parameter Descriptions:

Type

Name

Meaning

(Dict[Any:Any])

values_dict

{Element key : value} pairs

(Window)

RETURN

returns self so can be chained with other methods

finalize

Use this method to cause your layout to built into a real tkinter window. In reality this method is like
Read(timeout=0). It doesn't block and uses your layout to create tkinter widgets to represent the elements.
Lots of action!

finalize()

Type

Name

Meaning

return

Returns 'self' so that method "Chaining" can happen (read up about it as it's very cool!)

find

Find element object associated with the provided key.
THIS METHOD IS NO LONGER NEEDED to be called by the user

You can perform the same operation by writing this statement:
element = window[key]

You can drop the entire "FindElement" function name and use [ ] instead.

Typically used in combination with a call to element's Update method (or any other element method!):
window[key].Update(new_value)

Versus the "old way"
window.FindElement(key).Update(new_value)

This call can be abbreviated to any of these:
FindElement == Element == Find
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.

find(key, silent_on_error=False)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Used with window.FindElement and with return values to uniquely identify this element

bool

silent_on_error

If True do not display popup nor print warning of key errors

Union[Element, Error Element, None]

RETURN

Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;

find_element

Find element object associated with the provided key.
THIS METHOD IS NO LONGER NEEDED to be called by the user

You can perform the same operation by writing this statement:
element = window[key]

You can drop the entire "FindElement" function name and use [ ] instead.

Typically used in combination with a call to element's Update method (or any other element method!):
window[key].Update(new_value)

Versus the "old way"
window.FindElement(key).Update(new_value)

This call can be abbreviated to any of these:
FindElement == Element == Find
Rememeber that this call will return None if no match is found which may cause your code to crash if not
checked for.

find_element(key, silent_on_error=False)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Used with window.FindElement and with return values to uniquely identify this element

bool

silent_on_error

If True do not display popup nor print warning of key errors

Union[Element, Error Element, None]

RETURN

Return value can be: the Element that matches the supplied key if found; an Error Element if silent_on_error is False; None if silent_on_error True;

find_element_with_focus

Returns the Element that currently has focus as reported by tkinter. If no element is found None is returned!

find_element_with_focus()

Type

Name

Meaning

return

An Element if one has been found with focus or None if no element found

get_screen_dimensions

Get the screen dimensions. NOTE - you must have a window already open for this to work (blame tkinter not me)

get_screen_dimensions()

Type

Name

Meaning

return

Tuple containing width and height of screen in pixels

get_screen_size

Returns the size of the "screen" as determined by tkinter. This can vary depending on your operating system and the number of monitors installed on your system. For Windows, the primary monitor's size is returns. On some multi-monitored Linux systems, the monitors are combined and the total size is reported as if one screen.

get_screen_size() -> Tuple[int, int] - Size of the screen in pixels as determined by tkinter

grab_any_where_off

Turns off Grab Anywhere functionality AFTER a window has been created. Don't try on a window that's not yet
been Finalized or Read.

grab_any_where_off()

grab_any_where_on

Turns on Grab Anywhere functionality AFTER a window has been created. Don't try on a window that's not yet
been Finalized or Read.

grab_any_where_on()

hide

Hides the window from the screen and the task bar

hide()

layout

Second of two preferred ways of telling a Window what its layout is. The other way is to pass the layout as
a parameter to Window object. The parameter method is the currently preferred method. This call to Layout
has been removed from examples contained in documents and in the Demo Programs. Trying to remove this call
from history and replace with sending as a parameter to Window.

layout(rows)

Parameter Descriptions:

Type

Name

Meaning

List[List[Elements]]

rows

Your entire layout

(Window)

RETURN

self so that you can chain method calls

load_from_disk

Restore values from a previous call to SaveToDisk which saves the returned values dictionary in Pickle format

load_from_disk(filename)

Parameter Descriptions:

Type

Name

Meaning

str

filename

Pickle Filename to load

maximize

Maximize the window. This is done differently on a windows system versus a linux or mac one. For non-Windows
the root attribute '-fullscreen' is set to True. For Windows the "root" state is changed to "zoomed"
The reason for the difference is the title bar is removed in some cases when using fullscreen option

maximize()

minimize

Minimize this window to the task bar

minimize()

move

Move the upper left corner of this window to the x,y coordinates provided

move(x, y)

Parameter Descriptions:

Type

Name

Meaning

int

x

x coordinate in pixels

int

y

y coordinate in pixels

normal

Restore a window to a non-maximized state. Does different things depending on platform. See Maximize for more.

normal()

read

THE biggest deal method in the Window class! This is how you get all of your data from your Window.
Pass in a timeout (in milliseconds) to wait for a maximum of timeout milliseconds. Will return timeout_key
if no other GUI events happen first.

read(timeout=None,
timeout_key="__TIMEOUT__",
close=False)

Parameter Descriptions:

Type

Name

Meaning

int

timeout

Milliseconds to wait until the Read will return IF no other GUI events happen first

Any

timeout_key

The value that will be returned from the call if the timer expired

bool

close

if True the window will be closed prior to returning

Tuple[(Any), Union[Dict[Any:Any]], List[Any], None]

RETURN

(event, values)

reappear

Causes a window previously made to "Disappear" (using that method). Does this by restoring the alpha channel

reappear()

refresh

Refreshes the window by calling tkroot.update(). Can sometimes get away with a refresh instead of a Read.
Use this call when you want something to appear in your Window immediately (as soon as this function is called).
Without this call your changes to a Window will not be visible to the user until the next Read call

refresh()

Type

Name

Meaning

return

self so that method calls can be easily "chained"

save_to_disk

Saves the values contained in each of the input areas of the form. Basically saves what would be returned from a call to Read. It takes these results and saves them to disk using pickle.
Note that every element in your layout that is to be saved must have a key assigned to it.

save_to_disk(filename)

Parameter Descriptions:

Type

Name

Meaning

str

filename

Filename to save the values to in pickled form

send_to_back

Pushes this window to the bottom of the stack of windows. It is the opposite of BringToFront

send_to_back()

set_alpha

Sets the Alpha Channel for a window. Values are between 0 and 1 where 0 is completely transparent

set_alpha(alpha)

Parameter Descriptions:

Type

Name

Meaning

float

alpha

0 to 1. 0 is completely transparent. 1 is completely visible and solid (can't see through)

set_icon

Changes the icon that is shown on the title bar and on the task bar.
NOTE - The file type is IMPORTANT and depends on the OS!
Can pass in:
* filename which must be a .ICO icon file for windows, PNG file for Linux
* bytes object
* BASE64 encoded file held in a variable

set_icon(icon=None, pngbase64=None)

Parameter Descriptions:

Type

Name

Meaning

str

icon

Filename or bytes object

str

pngbase64

Base64 encoded image

set_transparent_color

Set the color that will be transparent in your window. Areas with this color will be SEE THROUGH.

set_transparent_color(color)

Parameter Descriptions:

Type

Name

Meaning

str

color

Color string that defines the transparent color

size

property: size

Return the current size of the window in pixels

Type

Name

Meaning

return

(width, height) of the window

un_hide

Used to bring back a window that was previously hidden using the Hide method

un_hide()

visibility_changed

This is a completely dummy method that does nothing. It is here so that PySimpleGUIQt programs can make this
call and then have that same source run on plain PySimpleGUI.

image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element

image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element

:param image_filename: image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: (Default = (None)) :param image_subsample:amount to reduce the size of the image :param tooltip: text, that will appear when mouse hovers over the element

image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element

Tuple[int, int]

size

(w,h) w=characters-wide, h=rows-high

bool

auto_size_button

True if button size is determined by button text

Tuple[str, str]

button_color

button color (foreground, background)

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

bool

disabled

set disable state for element (Default = False)

(int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int)

bind_return_key

(Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)

(Default = True) :param tooltip: text, that will appear when mouse hovers over the element

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

(int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int)

focus

if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)

Union[str, int, tuple]

key

key for uniquely identify this element (for window.FindElement)

(Button)

RETURN

returns a button

Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form

ObjToString(obj, extra=" ")

Parameter Descriptions:

Type

Name

Meaning

Any

obj

The object to display

str

extra

(Default value = ' ')

(str)

RETURN

Formatted output of the object's values

Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form
Returns only the top-most object's variables instead of drilling down to dispolay more

image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element

image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element

image filename if there is a button image :param image_data: in-RAM image to be displayed on button :param image_size: size of button image in pixels :param image_subsample:amount to reduce the size of the image :param border_width: width of border around element :param tooltip: text, that will appear when mouse hovers over the element

Tuple[int, int]

size

(w,h) w=characters-wide, h=rows-high

bool

auto_size_button

True if button size is determined by button text

Tuple[str, str]

button_color

button color (foreground, background)

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

bool

disabled

set disable state for element (Default = False)

(int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int)

bind_return_key

(Default = False) :param focus: if focus should be set to this :param pad: Amount of padding to put around element in pixels (left/right, top/bottom)

True if updated successfully. False if user closed the meter with the X or Cancel button

Cancels and closes a previously created One Line Progress Meter window

one_line_progress_meter_cancel(key)

Parameter Descriptions:

Type

Name

Meaning

Any

key

Key used when meter was created

Popup Functions

Popup - Display a popup Window with as many parms as you wish to include. This is the GUI equivalent of the
"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.

Variable number of your arguments. Load up the call with stuff to see!

str

title

Optional title for the window. If none provided, the first arg will be used instead.

Tuple[str, str]

button_color

Color of the buttons shown (text color, button color)

str

background_color

Window's background color

str

text_color

text color

int

button_type

NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect.

bool

auto_close

If True the window will automatically close

int

auto_close_duration

time in seconds to keep window open before closing it automatically

Union[Tuple[str, str], str]

custom_text

A string or pair of strings that contain the text to display on the buttons

bool

non_blocking

If True then will immediately return from the function without waiting for the user's input.

Union[str, bytes]

icon

icon to display on the window. Same format as a Window call

int

line_width

Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH

Union[str, tuple(font name, size, modifiers]

font

specifies the font family, size, etc

bool

no_titlebar

If True will not show the frame around the window and the titlebar across the top

bool

grab_anywhere

If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too

Tuple[int, int]

location

Location on screen to display the top left corner of window. Defaults to window centered on screen

Union[str, None]

RETURN

Returns text of the button that was pressed. None will be returned if user closed window with X

Show animation one frame at a time. This function has its own internal clocking meaning you can call it at any frequency
and the rate the frames of video is shown remains constant. Maybe your frames update every 30 ms but your
event loop is running every 10 ms. You don't have to worry about delaying, just call it every time through the
loop.

Older versions only accept int. Time in seconds until window will close

bool

non_blocking

if True the call will immediately return rather than waiting on user input

Union[bytes, str]

icon

filename or base64 string to be used for the window's icon

int

line_width

Width of lines in characters

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

bool

no_titlebar

If True no titlebar will be shown

bool

grab_anywhere

If True: can grab anywhere to move the window (Default = False)

bool

keep_on_top

If True the window will remain above all current windows

Tuple[int, int]

location

Location of upper left corner of the window

Union["Yes", "No", None]

RETURN

clicked button

Popups PEP8 Versions

Popup - Display a popup Window with as many parms as you wish to include. This is the GUI equivalent of the
"print" statement. It's also great for "pausing" your program's flow until the user can read some error messages.

Variable number of your arguments. Load up the call with stuff to see!

str

title

Optional title for the window. If none provided, the first arg will be used instead.

Tuple[str, str]

button_color

Color of the buttons shown (text color, button color)

str

background_color

Window's background color

str

text_color

text color

int

button_type

NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect.

bool

auto_close

If True the window will automatically close

int

auto_close_duration

time in seconds to keep window open before closing it automatically

Union[Tuple[str, str], str]

custom_text

A string or pair of strings that contain the text to display on the buttons

bool

non_blocking

If True then will immediately return from the function without waiting for the user's input.

Union[str, bytes]

icon

icon to display on the window. Same format as a Window call

int

line_width

Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH

Union[str, tuple(font name, size, modifiers]

font

specifies the font family, size, etc

bool

no_titlebar

If True will not show the frame around the window and the titlebar across the top

bool

grab_anywhere

If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too

Tuple[int, int]

location

Location on screen to display the top left corner of window. Defaults to window centered on screen

Union[str, None]

RETURN

Returns text of the button that was pressed. None will be returned if user closed window with X

Show animation one frame at a time. This function has its own internal clocking meaning you can call it at any frequency
and the rate the frames of video is shown remains constant. Maybe your frames update every 30 ms but your
event loop is running every 10 ms. You don't have to worry about delaying, just call it every time through the
loop.

Older versions only accept int. Time in seconds until window will close

bool

non_blocking

if True the call will immediately return rather than waiting on user input

Union[bytes, str]

icon

filename or base64 string to be used for the window's icon

int

line_width

Width of lines in characters

Union[str, Tuple[str, int]]

font

specifies the font family, size, etc

bool

no_titlebar

If True no titlebar will be shown

bool

grab_anywhere

If True: can grab anywhere to move the window (Default = False)

Tuple[int, int]

location

Location of upper left corner of the window

Displays a "notification window", usually in the bottom right corner of your display. Has an icon, a title, and a message. It is more like a "toaster" window than the normal popups.

The window will slowly fade in and out if desired. Clicking on the window will cause it to move through the end the current "phase". For example, if the window was fading in and it was clicked, then it would immediately stop fading in and instead be fully visible. It's a way for the user to quickly dismiss the window.

The return code specifies why the call is returning (e.g. did the user click the message to dismiss it)

A dictionary with element keys as key and value is values parm for Update call

The PySimpleGUI "Test Harness". This is meant to be a super-quick test of the Elements.

main()

Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form

obj_to_string(obj, extra=" ")

Parameter Descriptions:

Type

Name

Meaning

Any

obj

The object to display

str

extra

(Default value = ' ')

(str)

RETURN

Formatted output of the object's values

Dumps an Object's values as a formatted string. Very nicely done. Great way to display an object's member variables in human form
Returns only the top-most object's variables instead of drilling down to dispolay more

obj_to_string_single_obj(obj)

Sets the icon which will be used any time a window is created if an icon is not provided when the
window is created.

theme_slider_border_width(border_width=None) -> (int) - border width currently in use

Sets/Returns the slider color (used for sliders)

theme_slider_color(color=None) -> (str) - color string of the slider color currently in use

Sets/Returns the text color currently in use

theme_text_color(color=None) -> (str) - color string of the text color currently in use

Sets/Returns the background color for text elements

theme_text_element_background_color(color=None) -> (str) - color string of the text background color currently in use

Old Themes (Look and Feel) - Replaced by theme()

Change the "color scheme" of all future PySimpleGUI Windows.
The scheme are string names that specify a group of colors. Background colors, text colors, button colors.
There are 13 different color settings that are changed at one time using a single call to ChangeLookAndFeel
The look and feel table itself has these indexes into the dictionary LOOK_AND_FEEL_TABLE.
The original list was (prior to a major rework and renaming)... these names still work...
In Nov 2019 a new Theme Formula was devised to make choosing a theme easier:
The "Formula" is:
["Dark" or "Light"] Color Number
Colors can be Blue Brown Grey Green Purple Red Teal Yellow Black
The number will vary for each pair. There are more DarkGrey entries than there are LightYellow for example.
Default = The default settings (only button color is different than system default)
Default1 = The full system default including the button (everything's gray... how sad... don't be all gray... please....)

ChangeLookAndFeel(index, force=False)

Parameter Descriptions:

Type

Name

Meaning

str

index

the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy")

bool

force

no longer used

Get a list of the valid values to pass into your call to change_look_and_feel

ListOfLookAndFeelValues() -> List[str] - list of valid string values

Displays a "Quick Reference Window" showing all of the different Look and Feel settings that are available.
They are sorted alphabetically. The legacy color names are mixed in, but otherwise they are sorted into Dark and Light halves

preview_all_look_and_feel_themes(columns=12)

Get a list of the valid values to pass into your call to change_look_and_feel

Change the "color scheme" of all future PySimpleGUI Windows.
The scheme are string names that specify a group of colors. Background colors, text colors, button colors.
There are 13 different color settings that are changed at one time using a single call to ChangeLookAndFeel
The look and feel table itself has these indexes into the dictionary LOOK_AND_FEEL_TABLE.
The original list was (prior to a major rework and renaming)... these names still work...
In Nov 2019 a new Theme Formula was devised to make choosing a theme easier:
The "Formula" is:
["Dark" or "Light"] Color Number
Colors can be Blue Brown Grey Green Purple Red Teal Yellow Black
The number will vary for each pair. There are more DarkGrey entries than there are LightYellow for example.
Default = The default settings (only button color is different than system default)
Default1 = The full system default including the button (everything's gray... how sad... don't be all gray... please....)

change_look_and_feel(index, force=False)

Parameter Descriptions:

Type

Name

Meaning

str

index

the name of the index into the Look and Feel table (does not have to be exact, can be "fuzzy")