MCPcopy
hub / github.com/PySimpleGUI/PySimpleGUI / __init__

Method __init__

PySimpleGUI/PySimpleGUI.py:9838–10156  ·  view source on GitHub ↗

:param title: The title that will be displayed in the Titlebar and on the Taskbar :type title: (str) :param layout: The layout for the window. Can also be specified in the Layout met

(self, title, layout=None, default_element_size=None,
                 default_button_element_size=(None, None),
                 auto_size_text=None, auto_size_buttons=None, location=(None, None), relative_location=(None, None), auto_save_location=False, size=(None, None),
                 element_padding=None, margins=(None, None), button_color=None, font=None,
                 progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False,
                 auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=None, force_toplevel=False,
                 alpha_channel=None, return_keyboard_events=False, use_default_focus=True, text_justification=None,
                 no_titlebar=False, grab_anywhere=False, grab_anywhere_using_control=True, keep_on_top=None, resizable=False, disable_close=False,
                 disable_minimize=False, right_click_menu=None, transparent_color=None, debugger_enabled=False,
                 right_click_menu_background_color=None, right_click_menu_text_color=None, right_click_menu_disabled_text_color=None, right_click_menu_selected_colors=(None, None),
                 right_click_menu_font=None, right_click_menu_tearoff=False,
                 finalize=False, element_justification='left', ttk_theme=None, use_ttk_buttons=None, modal=False, enable_close_attempted_event=False,
                 enable_window_config_events=False, repeating_timer_ms=None,
                 titlebar_background_color=None, titlebar_text_color=None, titlebar_font=None, titlebar_icon=None,
                 use_custom_titlebar=None, scaling=None,
                 sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=None, watermark=None, print_event_values=None,
                 metadata=None)

Source from the content-addressed store, hash-verified

9836
9837
9838 def __init__(self, title, layout=None, default_element_size=None,
9839 default_button_element_size=(None, None),
9840 auto_size_text=None, auto_size_buttons=None, location=(None, None), relative_location=(None, None), auto_save_location=False, size=(None, None),
9841 element_padding=None, margins=(None, None), button_color=None, font=None,
9842 progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False,
9843 auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=None, force_toplevel=False,
9844 alpha_channel=None, return_keyboard_events=False, use_default_focus=True, text_justification=None,
9845 no_titlebar=False, grab_anywhere=False, grab_anywhere_using_control=True, keep_on_top=None, resizable=False, disable_close=False,
9846 disable_minimize=False, right_click_menu=None, transparent_color=None, debugger_enabled=False,
9847 right_click_menu_background_color=None, right_click_menu_text_color=None, right_click_menu_disabled_text_color=None, right_click_menu_selected_colors=(None, None),
9848 right_click_menu_font=None, right_click_menu_tearoff=False,
9849 finalize=False, element_justification='left', ttk_theme=None, use_ttk_buttons=None, modal=False, enable_close_attempted_event=False,
9850 enable_window_config_events=False, repeating_timer_ms=None,
9851 titlebar_background_color=None, titlebar_text_color=None, titlebar_font=None, titlebar_icon=None,
9852 use_custom_titlebar=None, scaling=None,
9853 sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=None, watermark=None, print_event_values=None,
9854 metadata=None):
9855 """
9856 :param title: The title that will be displayed in the Titlebar and on the Taskbar
9857 :type title: (str)
9858 :param layout: The layout for the window. Can also be specified in the Layout method
9859 :type layout: List[List[Element]] | Tuple[Tuple[Element]]
9860 :param default_element_size: size in characters (wide) and rows (high) for all elements in this window
9861 :type default_element_size: (int, int) - (width, height)
9862 :param default_button_element_size: (width, height) size in characters (wide) and rows (high) for all Button elements in this window
9863 :type default_button_element_size: (int, int)
9864 :param auto_size_text: True if Elements in Window should be sized to exactly fir the length of text
9865 :type auto_size_text: (bool)
9866 :param auto_size_buttons: True if Buttons in this Window should be sized to exactly fit the text on this.
9867 :type auto_size_buttons: (bool)
9868 :param location: (x,y) location, in pixels, to locate the upper left corner of the window on the screen. Default is to center on screen. None will not set any location meaning the OS will decide
9869 :type location: (int, int) or (None, None) or None
9870 :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.
9871 :type relative_location: (int, int)
9872 :param auto_save_location: If True the windows location will be automatically saved to a settings file and will be reloaded next time the program is run. Save happens when window close is detected
9873 :type auto_save_location: (bool)
9874 :param size: (width, height) size in pixels for this window. Normally the window is autosized to fit contents, not set to an absolute size by the user. Try not to set this value. You risk, the contents being cut off, etc. Let the layout determine the window size instead
9875 :type size: (int, int)
9876 :param element_padding: Default amount of padding to put around elements in window (left/right, top/bottom) or ((left, right), (top, bottom)), or an int. If an int, then it's converted into a tuple (int, int)
9877 :type element_padding: (int, int) or ((int, int),(int,int)) or int
9878 :param margins: (left/right, top/bottom) Amount of pixels to leave inside the window's frame around the edges before your elements are shown.
9879 :type margins: (int, int)
9880 :param button_color: Default button colors for all buttons in the window
9881 :type button_color: (str, str) | str
9882 :param font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
9883 :type font: (str or (str, int[, str]) or None)
9884 :param progress_bar_color: (bar color, background color) Sets the default colors for all progress bars in the window
9885 :type progress_bar_color: (str, str)
9886 :param background_color: color of background
9887 :type background_color: (str)
9888 :param border_depth: Default border depth (width) for all elements in the window
9889 :type border_depth: (int)
9890 :param auto_close: If True, the window will automatically close itself
9891 :type auto_close: (bool)
9892 :param auto_close_duration: Number of seconds to wait before closing the window
9893 :type auto_close_duration: (int)
9894 :param icon: Can be either a filename or Base64 value. For Windows if filename, it MUST be ICO format. For Linux, must NOT be ICO. Most portable is to use a Base64 of a PNG file. This works universally across all OS's
9895 :type icon: (str | bytes)

Callers

nothing calls this directly

Calls 9

button_color_to_tupleFunction · 0.85
theme_input_text_colorFunction · 0.85
user_settings_get_entryFunction · 0.85
TTKPartOverridesClass · 0.85
_GetAContainerNumberMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected