Web Analytics Made Easy - Statcounter
Skip to content

Pre-Defined Buttons

(use in your layout)

CalendarButton

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

CalendarButton(
    button_text,
    target = (None, None),
    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),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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
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)
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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target (int, int) or Any (None, None) Key or "coordinate" (see docs) of target element
tooltip str None text, that will appear when mouse hovers over the element
RETURN Button returns a button

Cancel

Cancel(
    button_text = "Cancel",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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 Cancel text in the button (Default value = 'Cancel')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

ColorChooserButton

ColorChooserButton(
    button_text,
    target = (None, None),
    image_filename = None,
    image_data = None,
    image_size = (None, None),
    image_subsample = None,
    tooltip = None,
    border_width = None,
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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 If True, then the return key will cause a the Listbox to generate an event
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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
target str or (int, int) (None, None) 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
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),
    auto_size_button = None,
    button_color = None,
    font = None,
    disabled = False,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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
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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

Exit

Exit(
    button_text = "Exit",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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 Exit text in the button (Default value = 'Exit')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

FileBrowse

FileBrowse(
    button_text = "Browse",
    target = (555666777, -1),
    file_types = (('ALL Files', '*.*'),),
    initial_folder = None,
    tooltip = None,
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    change_submits = False,
    font = None,
    disabled = False,
    pad = None,
    key = None
)

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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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
RETURN Button returns a button

FileSaveAs

FileSaveAs(
    button_text = "Save As...",
    target = (555666777, -1),
    file_types = (('ALL Files', '*.*'),),
    initial_folder = None,
    disabled = False,
    tooltip = None,
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    change_submits = False,
    font = None,
    pad = None,
    key = None
)

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)
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

FilesBrowse

Allows browsing of multiple files.

FilesBrowse(
    button_text = "Browse",
    target = (555666777, -1),
    file_types = (('ALL Files', '*.*'),),
    disabled = False,
    initial_folder = None,
    tooltip = None,
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    change_submits = False,
    font = None,
    pad = None,
    key = None
)

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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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
RETURN Button returns a button

FolderBrowse

FolderBrowse(
    button_text = "Browse",
    target = (555666777, -1),
    initial_folder = None,
    tooltip = None,
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    change_submits = False,
    font = None,
    pad = None,
    key = None
)

Parameter Descriptions

Name Type Default Description
auto_size_button bool None True if button size is determined by button text
button_color 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)
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
key str or int or tuple or object None Used with window.find_element and with return values to uniquely identify this element
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)
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
RETURN Button The Button created

Help

Help(
    button_text = "Help",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    font = None,
    tooltip = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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 Help text in the button (Default value = 'Quit')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

No

No(
    button_text = "No",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

OK

OK(
    button_text = "OK",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    bind_return_key = True,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    key = None
)

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, 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 OK text in the button (Default value = 'OK')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

Ok

Ok(
    button_text = "Ok",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    bind_return_key = True,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    key = None
)

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, 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 Ok text in the button (Default value = 'Ok')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

Open

Open(
    button_text = "Open",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    bind_return_key = True,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    key = None
)

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, 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 Open text in the button (Default value = 'Open')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

Quit

Quit(
    button_text = "Quit",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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 Quit text in the button (Default value = 'Quit')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

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),
    auto_size_button = None,
    button_color = None,
    font = None,
    disabled = False,
    bind_return_key = False,
    focus = False,
    pad = None,
    key = None
)

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
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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

Save

Save(
    button_text = "Save",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    bind_return_key = True,
    disabled = False,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    key = None
)

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, 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 Save text in the button (Default value = 'Save')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

SaveAs

SaveAs(
    button_text = "Save As...",
    target = (555666777, -1),
    file_types = (('ALL Files', '*.*'),),
    initial_folder = None,
    disabled = False,
    tooltip = None,
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    change_submits = False,
    font = None,
    pad = None,
    key = None
)

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)
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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
RETURN Button returns a button

Submit

Submit(
    button_text = "Submit",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    bind_return_key = True,
    tooltip = None,
    font = None,
    focus = False,
    pad = None,
    key = None
)

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, 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 Submit text in the button (Default value = 'Submit')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

Yes

Yes(
    button_text = "Yes",
    size = (None, None),
    auto_size_button = None,
    button_color = None,
    disabled = False,
    tooltip = None,
    font = None,
    bind_return_key = True,
    focus = False,
    pad = None,
    key = None
)

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 = 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 Yes text in the button (Default value = 'Yes')
disabled bool False set disable state for element (Default = False)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

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),
    auto_size_button = None,
    button_color = None,
    font = None,
    bind_return_key = False,
    disabled = False,
    focus = False,
    pad = None,
    key = None
)

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
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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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

DEPIRCATED

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),
    auto_size_button = None,
    button_color = None,
    font = None,
    bind_return_key = False,
    disabled = False,
    focus = False,
    pad = None,
    key = None
)

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
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)
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
key str or int or tuple or object None key for uniquely identify this element (for window.find_element)
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)
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