MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / popup_ok_cancel

Function popup_ok_cancel

PySimpleGUI/PySimpleGUI.py:21121–21170  ·  view source on GitHub ↗

Display popup with OK and Cancel buttons :param *args: Variable number of items to display :type *args: (Any) :param title: Title to display in the window. :type title: (str) :param button_color: button color

(*args, title=None, button_color=None, background_color=None, text_color=None, auto_close=False,
                    auto_close_duration=None, non_blocking=False, icon=DEFAULT_WINDOW_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)

Source from the content-addressed store, hash-verified

21119
21120# --------------------------- popup_ok_cancel ---------------------------
21121def popup_ok_cancel(*args, title=None, button_color=None, background_color=None, text_color=None, auto_close=False,
21122 auto_close_duration=None, non_blocking=False, icon=DEFAULT_WINDOW_ICON, line_width=None, font=None,
21123 no_titlebar=False, grab_anywhere=False, keep_on_top=None, location=(None, None), relative_location=(None, None), image=None, modal=True):
21124 """
21125 Display popup with OK and Cancel buttons
21126
21127 :param *args: Variable number of items to display
21128 :type *args: (Any)
21129 :param title: Title to display in the window.
21130 :type title: (str)
21131 :param button_color: button color (foreground, background)
21132 :type button_color: (str, str) | str
21133 :param background_color: color of background
21134 :type background_color: (str)
21135 :param text_color: color of the text
21136 :type text_color: (str)
21137 :param auto_close: if True window will close itself
21138 :type auto_close: (bool)
21139 :param auto_close_duration: Older versions only accept int. Time in seconds until window will close
21140 :type auto_close_duration: int | float
21141 :param non_blocking: if True the call will immediately return rather than waiting on user input
21142 :type non_blocking: (bool)
21143 :param icon: filename or base64 string to be used for the window's icon
21144 :type icon: bytes | str
21145 :param line_width: Width of lines in characters
21146 :type line_width: (int)
21147 :param font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
21148 :type font: (str or (str, int[, str]) or None)
21149 :param no_titlebar: If True no titlebar will be shown
21150 :type no_titlebar: (bool)
21151 :param grab_anywhere: If True: can grab anywhere to move the window (Default = False)
21152 :type grab_anywhere: (bool)
21153 :param keep_on_top: If True the window will remain above all current windows
21154 :type keep_on_top: (bool)
21155 :param location: Location of upper left corner of the window
21156 :type location: (int, int)
21157 :param relative_location: (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.
21158 :type relative_location: (int, int)
21159 :param image: Image to include at the top of the popup window
21160 :type image: (str) or (bytes)
21161 :param modal: 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
21162 :type modal: bool
21163 :return: clicked button
21164 :rtype: "OK" | "Cancel" | None
21165 """
21166 return popup(*args, title=title, button_type=POPUP_BUTTONS_OK_CANCEL, background_color=background_color,
21167 text_color=text_color,
21168 non_blocking=non_blocking, icon=icon, line_width=line_width, button_color=button_color,
21169 auto_close=auto_close, auto_close_duration=auto_close_duration, font=font, no_titlebar=no_titlebar,
21170 grab_anywhere=grab_anywhere, keep_on_top=keep_on_top, location=location, relative_location=relative_location, image=image, modal=modal)
21171
21172
21173# --------------------------- popup_yes_no ---------------------------

Callers

nothing calls this directly

Calls 1

popupFunction · 0.70

Tested by

no test coverage detected