Web Analytics Made Easy - Statcounter
Skip to content

Popups

Popups documentation

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

If this popup doesn't have the features you want, then you can easily make your own. Popups can be accomplished in 1 line of code: choice, _ = sg.Window('Continue?', [[sg.T('Do you want to continue?')], [sg.Yes(s=10), sg.No(s=10)]], disable_close=True).read(close=True)

popup(
    args = *<1 or N objects>,
    title = None,
    button_color = None,
    background_color = None,
    text_color = None,
    button_type = 0,
    auto_close = False,
    auto_close_duration = None,
    custom_text = (None, None),
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    any_key_closes = False,
    image = None,
    modal = True,
    button_justification = None,
    drop_whitespace = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of your arguments. Load up the call with stuff to see!
any_key_closes bool False If True then will turn on return_keyboard_events for the window which will cause window to close as soon as any key is pressed. Normally the return key only will close the window. Default is false.
auto_close bool False If True the window will automatically close
auto_close_duration int None time in seconds to keep window open before closing it automatically
background_color str None Window's background color
button_color (str, str) or str None Color of the buttons shown (text color, button color)
button_justification str None Speficies if buttons should be left, right or centered. Default is left justified
button_type int 0 NOT USER SET! Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK). There are many Popup functions and they call Popup, changing this parameter to get the desired effect.
custom_text (str, str) or str (None, None) A string or pair of strings that contain the text to display on the buttons
drop_whitespace bool True Controls is whitespace should be removed when wrapping text. Parameter is passed to textwrap.fill. Default is to drop whitespace (so popup remains backward compatible)
font str or Tuple[font_name, size, modifiers] None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
grab_anywhere bool False If True can grab anywhere to move the window. If no_titlebar is True, grab_anywhere should likely be enabled too
icon str or bytes None icon to display on the window. Same format as a Window call
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters. Defaults to MESSAGE_BOX_LINE_WIDTH
location (int, int) (None, None) Location on screen to display the top left corner of window. Defaults to window centered on screen
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True will not show the frame around the window and the titlebar across the top
non_blocking bool False If True then will immediately return from the function without waiting for the user's input.
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
right_justify_buttons bool If True then the buttons will be "pushed" to the right side of the Window
text_color str None text color
title str None Optional title for the window. If none provided, the first arg will be used instead.
RETURN str or None Returns text of the button that was pressed. None will be returned if user closed window with X

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

popup_animated(
    image_source,
    message = None,
    background_color = None,
    text_color = None,
    font = None,
    no_titlebar = True,
    grab_anywhere = True,
    keep_on_top = True,
    location = (None, None),
    relative_location = (None, None),
    alpha_channel = None,
    time_between_frames = 0,
    transparent_color = None,
    title = "",
    icon = None,
    no_buffering = False
)

Parameter Descriptions

Name Type Default Description
alpha_channel float None Window transparency 0 = invisible 1 = completely visible. Values between are see through
background_color str None color of background
font str or tuple None specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
grab_anywhere bool True If True then you can move the window just clicking anywhere on window, hold and drag
icon str or bytes None Same as Window icon parameter. Can be either a filename or Base64 byte string. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO
image_source str or bytes or None Either a filename or a base64 string. Use None to close the window.
keep_on_top bool True If True then Window will remain on top of all other windows currently shownn
location (int, int) (None, None) (x,y) location on the screen to place the top left corner of your window. Default is to center on screen
message str None An optional message to be shown with the animation
no_buffering bool False If True then no buffering will be used for the GIF. May work better if you have a large animation
no_titlebar bool True If True then the titlebar and window frame will not be shown
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
time_between_frames int 0 Amount of time in milliseconds between each frame
title str Title that will be shown on the window
transparent_color str None This color will be completely see-through in your window. Can even click through
RETURN bool True if the window updated OK. False if the window was closed or if the GIF has reached the end

This method is an alias for popup_no_titlebar

Popup that closes itself after some time period

popup_auto_close(
    args = *<1 or N objects>,
    title = None,
    button_type = 0,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = True,
    auto_close_duration = None,
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool True if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
button_type int 0 Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
non_blocking bool False if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

Display Popup with "cancelled" button text

popup_cancel(
    args = *<1 or N objects>,
    title = None,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = False,
    auto_close_duration = None,
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
non_blocking bool False if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

Popup with colored button and 'Error' as button text

popup_error(
    args = *<1 or N objects>,
    title = None,
    button_color = (None, None),
    background_color = None,
    text_color = None,
    auto_close = False,
    auto_close_duration = None,
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str (None, None) button color (foreground, background)
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
non_blocking bool False if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

Show an error message and as many additoinal lines of messages as you want. Will show the same error window as PySimpleGUI uses internally. Has a button to take the user to the line of code you called this popup from. If you include the Exception information in your messages, then it will be parsed and additional information will be in the window about such as the specific line the error itself occurred on.

popup_error_with_traceback(
    title,
    messages = *<1 or N objects>,
    emoji = None
)

Parameter Descriptions

Name Type Default Description
*messages Any A variable number of lines of messages you wish to show your user
emoji bytes None An optional BASE64 Encoded image to shows in the error window
title str The title that will be shown in the popup's titlebar and in the first line of the window

Display a calendar window, get the user's choice, return as a tuple (mon, day, year)

popup_get_date(
    start_mon = None,
    start_day = None,
    start_year = None,
    begin_at_sunday_plus = 0,
    no_titlebar = True,
    title = "Choose Date",
    keep_on_top = True,
    location = (None, None),
    relative_location = (None, None),
    close_when_chosen = False,
    icon = None,
    locale = None,
    month_names = None,
    day_abbreviations = None,
    day_font = "TkFixedFont 9",
    mon_year_font = "TkFixedFont 10",
    arrow_font = "TkFixedFont 7",
    modal = True
)

Parameter Descriptions

Name Type Default Description
arrow_font str or tuple TkFixedFont 7 Font and size to use for the arrow buttons
begin_at_sunday_plus int 0 Determines the left-most day in the display. 0=sunday, 1=monday, etc
close_when_chosen bool False If True, the window will close and function return when a day is clicked
day_abbreviations List[str] None optional list of abbreviations to display as the day of week
day_font str or tuple TkFixedFont 9 Font and size to use for the calendar
icon (str or bytes) None Same as Window icon parameter. Can be either a filename or Base64 value. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO
keep_on_top bool True If True the window will remain above all current windows
locale str None locale used to get the day names
location (int, int) (None, None) (x,y) location on the screen to place the top left corner of your window. Default is to center on screen
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
mon_year_font str or tuple TkFixedFont 10 Font and size to use for the month and year at the top
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
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
start_day int or None None The starting day - optional. Set to None or 0 if no date to be chosen at start
start_mon int None The starting month
start_year int None The starting year
title str Choose Date Title that will be shown on the window
RETURN None or (int, int, int) Tuple containing (month, day, year) of chosen date or None if was cancelled

Display popup window with text entry field and browse button so that a file can be chosen by user.

popup_get_file(
    message,
    title = None,
    default_path = "",
    default_extension = "",
    save_as = False,
    multiple_files = False,
    file_types = (('ALL Files', '*.* *'),),
    no_window = False,
    size = (None, None),
    button_color = None,
    background_color = None,
    text_color = None,
    icon = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    initial_folder = None,
    image = None,
    files_delimiter = ";",
    modal = True,
    history = False,
    show_hidden = True,
    history_setting_filename = None
)

Parameter Descriptions

Name Type Default Description
background_color str None background color of the entire window
button_color (str, str) or str None Color of the button (text, background)
default_extension str If no extension entered by user, add this to filename (only used in saveas dialogs)
default_path str path to display to user as starting point (filled into the input field)
file_types Tuple[Tuple[str,str]] (('ALL Files', '. *'),) List of extensions to show using wildcards. All files (the default) = (("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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
history bool False If True then enable a "history" feature that will display previous entries used. Uses settings filename provided or default if none provided
history_setting_filename str None Filename to use for the User Settings. Will store list of previous entries in this settings file
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
initial_folder str None location in filesystem to begin browsing
keep_on_top bool None If True the window will remain above all current windows
location (int, int) (None, None) Location of upper left corner of the window
message str message displayed to user
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
multiple_files bool False if True, then allows multiple files to be selected that are returned with ';' between each filename
no_titlebar bool False If True no titlebar will be shown
no_window bool False if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
save_as bool False if True, the "save as" dialog is shown which will verify before overwriting
show_hidden bool True If True then enables the checkbox in the system dialog to select hidden files to be shown
size (int, int) (None, None) (width, height) of the InputText Element or Combo element if using history feature
text_color str None color of the text
title str None Window title
RETURN str or None string representing the file(s) chosen, None if cancelled or window closed with X

Display popup with text entry field and browse button so that a folder can be chosen.

popup_get_folder(
    message,
    title = None,
    default_path = "",
    no_window = False,
    size = (None, None),
    button_color = None,
    background_color = None,
    text_color = None,
    icon = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    initial_folder = None,
    image = None,
    modal = True,
    history = False,
    history_setting_filename = None
)

Parameter Descriptions

Name Type Default Description
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
default_path str path to display to user as starting point (filled into the input field)
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
history bool False If True then enable a "history" feature that will display previous entries used. Uses settings filename provided or default if none provided
history_setting_filename str None Filename to use for the User Settings. Will store list of previous entries in this settings file
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
initial_folder str None location in filesystem to begin browsing
keep_on_top bool None If True the window will remain above all current windows
location (int, int) (None, None) Location of upper left corner of the window
message str message displayed to user
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
no_window bool False if True, no PySimpleGUI window will be shown. Instead just the tkinter dialog is shown
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
size (int, int) (None, None) (width, height) of the InputText Element
text_color str None color of the text
title str None Window title
RETURN str or None string representing the path chosen, None if cancelled or window closed with X

Display Popup with text entry field. Returns the text entered or None if closed / cancelled

popup_get_text(
    message,
    title = None,
    default_text = "",
    password_char = "",
    size = (None, None),
    button_color = None,
    background_color = None,
    text_color = None,
    icon = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    history = False,
    history_setting_filename = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
background_color str None background color of the entire window
button_color (str, str) or str None Color of the button (text, background)
default_text str default value to put into input area
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
grab_anywhere bool False If True can click and drag anywhere in the window to move the window
history bool False If True then enable a "history" feature that will display previous entries used. Uses settings filename provided or default if none provided
history_setting_filename str None Filename to use for the User Settings. Will store list of previous entries in this settings file
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
location (int, int) (None, None) (x,y) Location on screen to display the upper left corner of window
message str message displayed to user
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
password_char str character to be shown instead of actually typed characters. WARNING - if history=True then can't hide passwords
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
size (int, int) (None, None) (width, height) of the InputText Element
text_color str None color of the message text
title str None Window title
RETURN str or None Text entered or None if window was closed or cancel button clicked

Makes a "popup menu" This type of menu is what you get when a normal menu or a right click menu is torn off The settings for the menu are obtained from the window parameter's Window

popup_menu(
    window,
    element,
    menu_def,
    title = None,
    location = (None, None)
)

Parameter Descriptions

Name Type Default Description
element Element An element in your window to associate the menu to. It can be any element
location (int, int) or (None, None) (None, None) The location on the screen to place the window
menu_def List[List[ List[str] or str ]] A menu definition. This will be the same format as used for Right Click Menus1
title str None The title that will be shown on the torn off menu window. Defaults to window titlr
window Window The window associated with the popup menu. The theme and right click menu settings for this window will be used

This method is an alias for popup_no_titlebar

Show a Popup but without any buttons

popup_no_buttons(
    args = *<1 or N objects>,
    title = None,
    background_color = None,
    text_color = None,
    auto_close = False,
    auto_close_duration = None,
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
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
grab_anywhere bool False If True, than can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
non_blocking bool False If True then will immediately return from the function without waiting for the user's input. (Default = False)
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

This method is an alias for popup_no_titlebar

Display a Popup without a titlebar. Enables grab anywhere so you can move it

popup_no_titlebar(
    args = *<1 or N objects>,
    title = None,
    button_type = 0,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = False,
    auto_close_duration = None,
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    grab_anywhere = True,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
button_type int 0 Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
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
grab_anywhere bool True If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
non_blocking bool False if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

This method is an alias for popup_non_blocking

Show Popup window and immediately return (does not block)

popup_non_blocking(
    args = *<1 or N objects>,
    title = None,
    button_type = 0,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = False,
    auto_close_duration = None,
    non_blocking = True,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = False
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
button_type int 0 Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool False If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = False
no_titlebar bool False If True no titlebar will be shown
non_blocking bool True if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None Reason for popup closing

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

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

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

popup_notify(
    args = *<1 or N objects>,
    title = "",
    icon = ...,
    display_duration_in_ms = 3000,
    fade_in_duration = 1000,
    alpha = 0.9,
    location = None
)

Parameter Descriptions

Name Type Default Description
alpha float 0.9 Alpha channel. 0 - invisible 1 - fully visible
display_duration_in_ms int 3000 Number of milliseconds to show the window
fade_in_duration int 1000 Number of milliseconds to fade window in and out
icon bytes or str b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAEKAAABCgEWpLzLAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAHJQTFRF////ZsxmbbZJYL9gZrtVar9VZsJcbMRYaMZVasFYaL9XbMFbasRZaMFZacRXa8NYasFaasJaasFZasJaasNZasNYasJYasJZasJZasJZasJZasJZasJYasJZasJZasJZasJZasJaasJZasJZasJZasJZ2IAizQAAACV0Uk5TAAUHCA8YGRobHSwtPEJJUVtghJeYrbDByNjZ2tvj6vLz9fb3/CyrN0oAAADnSURBVDjLjZPbWoUgFIQnbNPBIgNKiwwo5v1fsQvMvUXI5oqPf4DFOgCrhLKjC8GNVgnsJY3nKm9kgTsduVHU3SU/TdxpOp15P7OiuV/PVzk5L3d0ExuachyaTWkAkLFtiBKAqZHPh/yuAYSv8R7XE0l6AVXnwBNJUsE2+GMOzWL8k3OEW7a/q5wOIS9e7t5qnGExvF5Bvlc4w/LEM4Abt+d0S5BpAHD7seMcf7+ZHfclp10TlYZc2y2nOqc6OwruxUWx0rDjNJtyp6HkUW4bJn0VWdf/a7nDpj1u++PBOR694+Ftj/8PKNdnDLn/V8YAAAAASUVORK5CYII=' A base64 encoded PNG/GIF image or PNG/GIF filename that will be displayed in the window
location (int, int) None Location on the screen to display the window
message str Text message that makes up the majority of the window
title str Text to be shown at the top of the window in a larger font
RETURN int reason for returning

Display Popup with OK button only

popup_ok(
    args = *<1 or N objects>,
    title = None,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = False,
    auto_close_duration = None,
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
non_blocking bool False if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

Display popup with OK and Cancel buttons

popup_ok_cancel(
    args = *<1 or N objects>,
    title = None,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = False,
    auto_close_duration = None,
    non_blocking = False,
    icon = ...,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str b'iVBORw0KGgoAAAANSUhEUgAAAEAAAAA4CAYAAABNGP5yAAAQFklEQVR4nLWba5RkVXXHf/uce6urqh8DCMGV4FsgMszDYAxqspgxAZkBedo1ibCECDoxRlfQLBUdproaCCCKrpj4iAGJixVIdUAQZsYHZgaXwUAcZXqGwRBjjBENiMP0o973nJ0Pt7q7urpuPQayP3TXvffcc/b/f87ZZ5+9zxVeAFEdtyJTbvF635oTyAZpylGVRuqQvG5vuVO5LiIUi4ZcLi6b3zlGyBkovwecjMqvI2pAHkPlfraffS8Ax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Kl3HaJYtEinAxIQ589aMlKdZZA8Ryzjxz3jKRYt2875HtXyx0kPWyDq7m0OKh3e1+a+oTz3dfLnfoK8mubhyUSPqdy5X3olIPuQXC4mYfK8D1Oe+QrDq0LUt5wJfD71dwyOxvuGyvx3qdYuic8QLwEZ0NwPkN5LBqKMj3tUBVe6ktLMo6SHmwcjn+9IWBGdjsiMBtQr05RmzufGi34VV73k6C0nYMOvLTwo4QfVoVvgsv2RKBMTQiF3iFJlM43qEwyNBC/cSIB4xzgaUK88QqOyiRtyv0R16VuEpiSsAu3H2/qR5LLGdDjRUSh4xouWGy/6FXW/mUb1cdIjAbpwRPYIQ+3x1xRxz9fK93C4fCaFC35OXg0iK/RIWgYPE+kL4A8AinrRzhGWqZyLU1WbfkJ97mwa1X8j2zwnrP1kp5YNd0W9IwgNmZGAWvnLNB4e5+YL5tpPh7bKcld4Yipu1KUeJ2qUCWSISNsORQ+QCInjMWKMeTqxzCIJF/+M/FfOAj5PZmxL7Oa6CLAkpoW0CRyPMZbMiKVePki5fC3b33IXqJAnETydkKjmjUjB6xPrPslx4Qd4tgEOT/ejGZ0MsDJkAiItY806OfEHP9I8RgoJJ7xavxWa/NoHseZahrIZaiXwzi9XV4mzqioYaxgahnqljHe30PA3U9g829wdLhTuqnYbAc17e86wHH/4k4RcgpEXEXaN/Ky8FPB1nTcNf7m8Zvru5hG87sHGhSknokzuOpnAvg+vlxKkVsVh9ZaPpRYYb9RmEPMVXOMWtp+zHxjo67HeIZ0n15yA2t+vRfqS+TlnwMtK07EQe1z6nUqb+qg1O2XNY/u69nwnaQUw+Y0TMXomIhvw7uUoIcLPUfkvjExjoj189Jwn4/fUMo7v9Z1Qq/wf9GqvpKr/2kkAAAAASUVORK5CYII=' filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
non_blocking bool False if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN "OK" or "Cancel" or None clicked button

Show Popup box that doesn't block and closes itself

popup_quick(
    args = *<1 or N objects>,
    title = None,
    button_type = 0,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = True,
    auto_close_duration = 2,
    non_blocking = True,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = False
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool True if True window will close itself
auto_close_duration int or float 2 Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
button_type int 0 Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool False If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = False
no_titlebar bool False If True no titlebar will be shown
non_blocking bool True if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

Show Popup window with no titlebar, doesn't block, and auto closes itself.

popup_quick_message(
    args = *<1 or N objects>,
    title = None,
    button_type = 5,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = True,
    auto_close_duration = 2,
    non_blocking = True,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = True,
    grab_anywhere = False,
    keep_on_top = True,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = False
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool True if True window will close itself
auto_close_duration int or float 2 Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
button_type int 5 Determines which pre-defined buttons will be shown (Default value = POPUP_BUTTONS_OK).
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool True If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool False If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = False
no_titlebar bool True If True no titlebar will be shown
non_blocking bool True if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

Show a scrolled Popup window containing the user's text that was supplied. Use with as many items to print as you want, just like a print statement.

popup_scrolled(
    args = *<1 or N objects>,
    title = None,
    button_color = None,
    background_color = None,
    text_color = None,
    yes_no = False,
    no_buttons = False,
    button_justification = "l",
    auto_close = False,
    auto_close_duration = None,
    size = (None, None),
    location = (None, None),
    relative_location = (None, None),
    non_blocking = False,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    font = None,
    image = None,
    icon = None,
    modal = True,
    no_sizegrip = False
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
button_justification str l How buttons should be arranged. l, c, r for Left, Center or Right justified
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
grab_anywhere bool False If True, than can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
location (int, int) (None, None) Location on the screen to place the upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_buttons bool False If True, no buttons will be shown. User will have to close using the "X"
no_sizegrip bool False If True no Sizegrip will be shown when there is no titlebar. It's only shown if there is no titlebar
no_titlebar bool False If True no titlebar will be shown
non_blocking bool False if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
size (int, int) (None, None) (w,h) w=characters-wide, h=rows-high
text_color str None color of the text
title str None Title to display in the window.
yes_no bool False If True, displays Yes and No buttons instead of Ok
RETURN str or None or TIMEOUT_KEY Returns text of the button that was pressed. None will be returned if user closed window with X

This method is an alias for popup_auto_close

Display Popup with Yes and No buttons

popup_yes_no(
    args = *<1 or N objects>,
    title = None,
    button_color = None,
    background_color = None,
    text_color = None,
    auto_close = False,
    auto_close_duration = None,
    non_blocking = False,
    icon = None,
    line_width = None,
    font = None,
    no_titlebar = False,
    grab_anywhere = False,
    keep_on_top = None,
    location = (None, None),
    relative_location = (None, None),
    image = None,
    modal = True
)

Parameter Descriptions

Name Type Default Description
*args Any Variable number of items to display
auto_close bool False if True window will close itself
auto_close_duration int or float None Older versions only accept int. Time in seconds until window will close
background_color str None color of background
button_color (str, str) or str None button color (foreground, background)
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
grab_anywhere bool False If True: can grab anywhere to move the window (Default = False)
icon bytes or str None filename or base64 string to be used for the window's icon
image str or bytes None Image to include at the top of the popup window
keep_on_top bool None If True the window will remain above all current windows
line_width int None Width of lines in characters
location (int, int) (None, None) Location of upper left corner of the window
modal bool True If True then makes the popup will behave like a Modal window... all other windows are non-operational until this one is closed. Default = True
no_titlebar bool False If True no titlebar will be shown
non_blocking bool False if True the call will immediately return rather than waiting on user input
relative_location (int, int) (None, None) (x,y) location relative to the default location of the window, in pixels. Normally the window centers. This location is relative to the location the window would be created. Note they can be negative.
text_color str None color of the text
title str None Title to display in the window.
RETURN "Yes" or "No" or None clicked button

sprint Popup Alias - Same as popup_scrolled

sprint

This method is an alias for popup_scrolled