Web Analytics Made Easy - Statcounter
Skip to content

Pre-Defined Buttons

Button documentation
Button call reference

(use in your layout)

CalendarButton

Button that will show a calendar chooser window. Fills in the target element with result

CalendarButton(
    button_text,
    target = (555666777, -1),
    close_when_date_chosen = True,
    default_date_m_d_y = (None, None, None),
    image_filename = None,
    image_data = None,
    image_size = (None, None),
    image_subsample = None,
    tooltip = None,
    border_width = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    enable_events = None,
    key = None,
    k = None,
    visible = True,
    locale = None,
    format = "%Y-%m-%d %H:%M:%S",
    begin_at_sunday_plus = 0,
    month_names = None,
    day_abbreviations = None,
    title = "Choose Date",
    no_titlebar = True,
    location = (None, None),
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
begin_at_sunday_plus int 0 Determines the left-most day in the display. 0=sunday, 1=monday, etc
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
border_width width of border around element None width of border around element
button_color (str, str) or str None button color (foreground, background)
button_text str text in the button
close_when_date_chosen bool True (Default = True)
day_abbreviations List[str] None optional list of abbreviations to display as the day of week
default_date_m_d_y (int, int or None, int) (None, None, None) Beginning date to show
disabled bool False set disable state for element (Default = False)
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
focus bool False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
format str %Y-%m-%d %H:%M:%S formats result using this strftime format
image_data in-RAM image to be displayed on button None in-RAM image to be displayed on button
image_filename image filename if there is a button image None image filename if there is a button image
image_size (Default = (None)) (None, None) image size (O.K.)
image_subsample amount to reduce the size of the image None amount to reduce the size of the image
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 key for uniquely identify this element (for window.find_element)
locale str None defines the locale used to get day names
location (int, int) (None, None) Location on the screen (x,y) to show the calendar popup window
metadata Any None Anything you want to store along with this button
month_names List[str] None optional list of month names to use (should be 12 items)
no_titlebar bool True if True no titlebar will be shown on the date chooser window
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target (int, int) or Any (555666777, -1) Key or "coordinate" (see docs) of target element
title str Choose Date Title shown on the date chooser window
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Cancel

Cancel(
    button_text = "Cancel",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Cancel text in the button (Default value = 'Cancel')
disabled bool False set disable state for element (Default = False)
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
focus False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

ColorChooserButton

ColorChooserButton(
    button_text,
    target = (555666777, -1),
    image_filename = None,
    image_data = None,
    image_size = (None, None),
    image_subsample = None,
    tooltip = None,
    border_width = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    default_color = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
border_width int None width of border around element
button_color (str, str) or str None button color (foreground, background)
button_text str text in the button
default_color str None Color to be sent to tkinter to use as the default color
disabled bool False set disable state for element (Default = False)
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
focus bool False Determines if initial focus should go to this element.
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
image_data bytes or str None Raw or Base64 representation of the image to put on button. Choose either filename or data
image_filename str None image filename if there is a button image. GIFs and PNGs only.
image_size (int, int) (None, None) Size of the image in pixels (width, height)
image_subsample int None amount to reduce the size of the image. Divides the size by this number. 2=1/2, 3=1/3, 4=1/4, etc
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 key for uniquely identify this element (for window.find_element)
metadata Any None User metadata that can be set to ANYTHING
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target str or (int, int) (555666777, -1) 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
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Debug

This Button has been changed in how it works!! Your button has been replaced with a normal button that has the PySimpleGUI Debugger buggon logo on it. In your event loop, you will need to check for the event of this button and then call: show_debugger_popout_window()

Debug(
    button_text = "",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    font = None,
    tooltip = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str text in the button (Default value = '')
disabled bool False set disable state for element (Default = False)
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
focus False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

DummyButton

This is a special type of Button.

It will close the window but NOT send an event that the window has been closed.

It's used in conjunction with non-blocking windows to silently close them. They are used to implement the non-blocking popup windows. They're also found in some Demo Programs, so look there for proper use.

DummyButton(
    button_text,
    image_filename = None,
    image_data = None,
    image_size = (None, None),
    image_subsample = None,
    border_width = None,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    font = None,
    disabled = False,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
border_width int None width of border around element
button_color (str, str) or str None button color (foreground, background)
button_text str text in the button
disabled bool False set disable state for element (Default = False)
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
focus bool False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
image_data in-RAM image to be displayed on button None in-RAM image to be displayed on button
image_filename image filename if there is a button image None image filename if there is a button image
image_size (Default = (None)) (None, None) image size (O.K.)
image_subsample amount to reduce the size of the image None amount to reduce the size of the image
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Exit

Exit(
    button_text = "Exit",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Exit text in the button (Default value = 'Exit')
disabled bool False set disable state for element (Default = False)
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
focus False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

FileBrowse

FileBrowse(
    button_text = "Browse",
    target = (555666777, -1),
    file_types = (('ALL Files', '*.* *'),),
    initial_folder = None,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    change_submits = False,
    enable_events = False,
    font = None,
    disabled = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
button_color (str, str) or str None button color (foreground, background)
button_text str Browse text in the button (Default value = 'Browse')
change_submits bool False If True, pressing Enter key submits window (Default = False)
disabled bool False set disable state for element (Default = False)
enable_events bool False Turns on the element specific events.(Default = False)
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
file_types Tuple[(str, str), ...] (('ALL Files', '. *'),) filter file types Default value = (("ALL Files", ". *"),).
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
initial_folder None starting path for folders and files
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target str or (int, int) (555666777, -1) key or (row,col) target for the button (Default value = (ThisRow, -1))
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

FileSaveAs

FileSaveAs(
    button_text = "Save As...",
    target = (555666777, -1),
    file_types = (('ALL Files', '*.* *'),),
    initial_folder = None,
    default_extension = "",
    disabled = False,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    change_submits = False,
    enable_events = False,
    font = None,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
button_color (str, str) or str None button color (foreground, background)
button_text str Save As... text in the button (Default value = 'Save As...')
change_submits bool False If True, pressing Enter key submits window (Default = False)
default_extension str If no extension entered by user, add this to filename (only used in saveas dialogs)
disabled bool False set disable state for element (Default = False)
enable_events bool False Turns on the element specific events.(Default = False)
expand_x bool False If True Element will expand in the Horizontal directions
expand_y bool) :return: returns a button False If True Element will expand in the Vertical directions
file_types Tuple[(str, str), ...] (('ALL Files', '. *'),) Default value = (("ALL Files", ". *"),).
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
initial_folder str None starting path for folders and files
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target str or (int, int) (555666777, -1) key or (row,col) target for the button (Default value = (ThisRow, -1))
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

FilesBrowse

Allows browsing of multiple files. File list is returned as a single list with the delimiter defined using the files_delimiter parameter.

FilesBrowse(
    button_text = "Browse",
    target = (555666777, -1),
    file_types = (('ALL Files', '*.* *'),),
    disabled = False,
    initial_folder = None,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    change_submits = False,
    enable_events = False,
    font = None,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    files_delimiter = ";",
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
button_color (str, str) or str None button color (foreground, background)
button_text str Browse text in the button (Default value = 'Browse')
change_submits bool False If True, pressing Enter key submits window (Default = False)
disabled bool False set disable state for element (Default = False)
enable_events bool False Turns on the element specific events.(Default = False)
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
file_types Tuple[(str, str), ...] (('ALL Files', '. *'),) Default value = (("ALL Files", ". *"),).
files_delimiter str ; String to place between files when multiple files are selected. Normally a ;
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
initial_folder str None starting path for folders and files
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target str or (int, int) (555666777, -1) key or (row,col) target for the button (Default value = (ThisRow, -1))
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

FolderBrowse

FolderBrowse(
    button_text = "Browse",
    target = (555666777, -1),
    initial_folder = None,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    change_submits = False,
    enable_events = False,
    font = None,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
button_color (str, str) or str None button color (foreground, background)
button_text str Browse text in the button (Default value = 'Browse')
change_submits bool False If True, pressing Enter key submits window (Default = False)
disabled bool False set disable state for element (Default = False)
enable_events bool False Turns on the element specific events.(Default = False)
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
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
initial_folder str None starting path for folders and files
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 Used with window.find_element and with return values to uniquely identify this element
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target str or (int, int) (555666777, -1) target for the button (Default value = (ThisRow, -1))
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button The Button created

Help

Help(
    button_text = "Help",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    font = None,
    tooltip = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Help text in the button (Default value = 'Help')
disabled bool False set disable state for element (Default = False)
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
focus False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

No

No(
    button_text = "No",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, then the return key will cause a the Listbox to generate an event
button_color (str, str) or str None button color (foreground, background)
button_text str No text in the button (Default value = 'No')
disabled bool False set disable state for element (Default = False)
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
focus False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

OK

OK(
    button_text = "OK",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    bind_return_key = True,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool True (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str OK text in the button (Default value = 'OK')
disabled bool False set disable state for element (Default = False)
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
focus idk_yetReally False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Ok

Ok(
    button_text = "Ok",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    bind_return_key = True,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool True (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Ok text in the button (Default value = 'Ok')
disabled bool False set disable state for element (Default = False)
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
focus idk_yetReally False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Open

Open(
    button_text = "Open",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    bind_return_key = True,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool True (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Open text in the button (Default value = 'Open')
disabled bool False set disable state for element (Default = False)
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
focus idk_yetReally False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Quit

Quit(
    button_text = "Quit",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Quit text in the button (Default value = 'Quit')
disabled bool False set disable state for element (Default = False)
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
focus bool False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

RealtimeButton

RealtimeButton(
    button_text,
    image_filename = None,
    image_data = None,
    image_size = (None, None),
    image_subsample = None,
    border_width = None,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    font = None,
    disabled = False,
    bind_return_key = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
border_width int None width of border around element
button_color (str, str) or str None button color (foreground, background)
button_text str text in the button
disabled bool False set disable state for element (Default = False)
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
focus bool False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
image_data in-RAM image to be displayed on button None in-RAM image to be displayed on button
image_filename image filename if there is a button image None image filename if there is a button image
image_size (Default = (None)) (None, None) image size (O.K.)
image_subsample amount to reduce the size of the image None amount to reduce the size of the image
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button Button created

Save

Save(
    button_text = "Save",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    bind_return_key = True,
    disabled = False,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool True (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Save text in the button (Default value = 'Save')
disabled bool False set disable state for element (Default = False)
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
focus idk_yetReally False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

SaveAs

SaveAs(
    button_text = "Save As...",
    target = (555666777, -1),
    file_types = (('ALL Files', '*.* *'),),
    initial_folder = None,
    default_extension = "",
    disabled = False,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    change_submits = False,
    enable_events = False,
    font = None,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
button_color (str, str) or str None button color (foreground, background)
button_text str Save As... text in the button (Default value = 'Save As...')
change_submits bool False If True, pressing Enter key submits window (Default = False)
default_extension str If no extension entered by user, add this to filename (only used in saveas dialogs)
disabled bool False set disable state for element (Default = False)
enable_events bool False Turns on the element specific events.(Default = False)
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
file_types Tuple[(str, str), ...] (('ALL Files', '. *'),) Default value = (("ALL Files", ". *"),).
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
initial_folder str None starting path for folders and files
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.
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int :param key: key for uniquely identify this element (for window.find_element) None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target str or (int, int) (555666777, -1) key or (row,col) target for the button (Default value = (ThisRow, -1))
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Submit

Submit(
    button_text = "Submit",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    bind_return_key = True,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool True (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Submit text in the button (Default value = 'Submit')
disabled bool False set disable state for element (Default = False)
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
focus idk_yetReally False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Yes

Yes(
    button_text = "Yes",
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = True,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    visible = True,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool True (Default = True) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str Yes text in the button (Default value = 'Yes')
disabled bool False set disable state for element (Default = False)
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
focus False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
visible bool True set initial visibility state of the Button
RETURN Button returns a button

Button Functions No Longer Used (DO NOT USE)

Note - These are no longer recommended! They are shown here in case you run into them in some old code.

RButton

This method is an alias for ReadButton

ReadButton

ReadButton(
    button_text,
    image_filename = None,
    image_data = None,
    image_size = (None, None),
    image_subsample = None,
    border_width = None,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    font = None,
    bind_return_key = False,
    disabled = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
border_width int None width of border around element
button_color (str, str) or str None button color (foreground, background)
button_text str text in the button
disabled bool False set disable state for element (Default = False)
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
focus idk_yetReally False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
image_data in-RAM image to be displayed on button None in-RAM image to be displayed on button
image_filename image filename if there is a button image None image filename if there is a button image
image_size (Default = (None)) (None, None) image size (O.K.)
image_subsample amount to reduce the size of the image None amount to reduce the size of the image
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
RETURN Button Button created

CButton

This method is an alias for CloseButton

CloseButton

DEPRICATED

This button should not be used. Instead explicitly close your windows by calling window.close() or by using the close parameter in window.read

CloseButton(
    button_text,
    image_filename = None,
    image_data = None,
    image_size = (None, None),
    image_subsample = None,
    border_width = None,
    tooltip = None,
    size = (None, None),
    s = (None, None),
    auto_size_button = None,
    button_color = None,
    font = None,
    bind_return_key = False,
    disabled = False,
    focus = False,
    pad = None,
    p = None,
    key = None,
    k = None,
    metadata = None,
    expand_x = False,
    expand_y = False
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
bind_return_key bool False (Default = False) If True, this button will appear to be clicked when return key is pressed in other elements such as Input and elements with return key options
button_color (str, str) or str None button color (foreground, background)
button_text str text in the button
disabled bool False set disable state for element (Default = False)
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
focus idk_yetReally False if focus should be set to this
font (str or (str, int[, str]) or None) None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
image_data in-RAM image to be displayed on button None in-RAM image to be displayed on button
image_filename image filename if there is a button image None image filename if there is a button image
image_size (Default = (None)) (None, None) image size (O.K.)
image_subsample amount to reduce the size of the image None amount to reduce the size of the image
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 key for uniquely identify this element (for window.find_element)
metadata Any None Anything you want to store along with this button
p (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Same as pad parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, pad will be used
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
s (int, int) or (None, None) or int (None, None) Same as size parameter. It's an alias. If EITHER of them are set, then the one that's set will be used. If BOTH are set, size will be used
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
tooltip str None text, that will appear when mouse hovers over the element
RETURN Button returns a button