Merge pull request #5408 from PySimpleGUI/Dev-latest

Added parms and doctrings for Output Element and Column element.  Nee…
This commit is contained in:
PySimpleGUI 2022-04-26 15:46:21 -04:00 committed by GitHub
commit ec4428d3ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 219 additions and 170 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.59.0.28 Released 5-Apr-2022" version = __version__ = "4.59.0.29 Released 5-Apr-2022"
_change_log = """ _change_log = """
Changelog since 4.59.0 released to PyPI on 5-Apr-2022 Changelog since 4.59.0 released to PyPI on 5-Apr-2022
@ -98,6 +98,9 @@ _change_log = """
first simply make sure it's working. Changes were limited to the scrollable column class (which was the scene of the hack-crime too) first simply make sure it's working. Changes were limited to the scrollable column class (which was the scene of the hack-crime too)
4.59.0.28 4.59.0.28
fixed the Column.update call! Missed the renaming of the ExpandX to expand_x in that function. Sorry if you hit it! fixed the Column.update call! Missed the renaming of the ExpandX to expand_x in that function. Sorry if you hit it!
4.59.0.29
Added parms and docstrings to all elements with ttk scrollbars
Needed to remove the "arrow background color" option for ttk scrollbars. You can't set that color directly it turns out... so one less parm now
""" """
__version__ = version.split()[0] # For PEP 396 and PEP 345 __version__ = version.split()[0] # For PEP 396 and PEP 345
@ -858,19 +861,17 @@ PSG_THEME_PART_LIST = [PSG_THEME_PART_BACKGROUND, PSG_THEME_PART_BUTTON_BACKGROU
TTK_SCROLLBAR_PART_TROUGH_COLOR = 'Trough Color' TTK_SCROLLBAR_PART_TROUGH_COLOR = 'Trough Color'
TTK_SCROLLBAR_PART_BACKGROUND_COLOR = 'Background Color' TTK_SCROLLBAR_PART_BACKGROUND_COLOR = 'Background Color'
TTK_SCROLLBAR_PART_ARROW_BUTTON_BACKGROUND_COLOR = 'Arrow Button Backround Color'
TTK_SCROLLBAR_PART_ARROW_BUTTON_ARROW_COLOR = 'Arrow Button Arrow Color' TTK_SCROLLBAR_PART_ARROW_BUTTON_ARROW_COLOR = 'Arrow Button Arrow Color'
TTK_SCROLLBAR_PART_FRAME_COLOR = 'Frame Color' TTK_SCROLLBAR_PART_FRAME_COLOR = 'Frame Color'
TTK_SCROLLBAR_PART_SCROLL_WIDTH = 'Frame Width' TTK_SCROLLBAR_PART_SCROLL_WIDTH = 'Frame Width'
TTK_SCROLLBAR_PART_ARROW_WIDTH = 'Arrow Width' TTK_SCROLLBAR_PART_ARROW_WIDTH = 'Arrow Width'
TTK_SCROLLBAR_PART_RELIEF = 'Relief' TTK_SCROLLBAR_PART_RELIEF = 'Relief'
TTK_SCROLLBAR_PART_LIST = [TTK_SCROLLBAR_PART_TROUGH_COLOR, TTK_SCROLLBAR_PART_BACKGROUND_COLOR, TTK_SCROLLBAR_PART_ARROW_BUTTON_BACKGROUND_COLOR, TTK_SCROLLBAR_PART_ARROW_BUTTON_ARROW_COLOR, TTK_SCROLLBAR_PART_LIST = [TTK_SCROLLBAR_PART_TROUGH_COLOR, TTK_SCROLLBAR_PART_BACKGROUND_COLOR, TTK_SCROLLBAR_PART_ARROW_BUTTON_ARROW_COLOR,
TTK_SCROLLBAR_PART_FRAME_COLOR, TTK_SCROLLBAR_PART_SCROLL_WIDTH, TTK_SCROLLBAR_PART_ARROW_WIDTH, TTK_SCROLLBAR_PART_RELIEF] TTK_SCROLLBAR_PART_FRAME_COLOR, TTK_SCROLLBAR_PART_SCROLL_WIDTH, TTK_SCROLLBAR_PART_ARROW_WIDTH, TTK_SCROLLBAR_PART_RELIEF]
TTK_SCROLLBAR_PART_THEME_BASED_LIST = [TTK_SCROLLBAR_PART_TROUGH_COLOR, TTK_SCROLLBAR_PART_BACKGROUND_COLOR, TTK_SCROLLBAR_PART_ARROW_BUTTON_BACKGROUND_COLOR, TTK_SCROLLBAR_PART_ARROW_BUTTON_ARROW_COLOR, TTK_SCROLLBAR_PART_THEME_BASED_LIST = [TTK_SCROLLBAR_PART_TROUGH_COLOR, TTK_SCROLLBAR_PART_BACKGROUND_COLOR, TTK_SCROLLBAR_PART_ARROW_BUTTON_ARROW_COLOR,
TTK_SCROLLBAR_PART_FRAME_COLOR] TTK_SCROLLBAR_PART_FRAME_COLOR]
DEFAULT_TTK_PART_MAPPING_DICT = {TTK_SCROLLBAR_PART_TROUGH_COLOR: PSG_THEME_PART_SLIDER, DEFAULT_TTK_PART_MAPPING_DICT = {TTK_SCROLLBAR_PART_TROUGH_COLOR: PSG_THEME_PART_SLIDER,
TTK_SCROLLBAR_PART_BACKGROUND_COLOR : PSG_THEME_PART_BUTTON_BACKGROUND, TTK_SCROLLBAR_PART_BACKGROUND_COLOR : PSG_THEME_PART_BUTTON_BACKGROUND,
TTK_SCROLLBAR_PART_ARROW_BUTTON_BACKGROUND_COLOR : PSG_THEME_PART_BUTTON_BACKGROUND,
TTK_SCROLLBAR_PART_ARROW_BUTTON_ARROW_COLOR :PSG_THEME_PART_BUTTON_TEXT, TTK_SCROLLBAR_PART_ARROW_BUTTON_ARROW_COLOR :PSG_THEME_PART_BUTTON_TEXT,
TTK_SCROLLBAR_PART_FRAME_COLOR : PSG_THEME_PART_BACKGROUND, TTK_SCROLLBAR_PART_FRAME_COLOR : PSG_THEME_PART_BACKGROUND,
TTK_SCROLLBAR_PART_SCROLL_WIDTH : 12, TTK_SCROLLBAR_PART_SCROLL_WIDTH : 12,
@ -1008,7 +1009,7 @@ class Element():
def __init__(self, type, size=(None, None), auto_size_text=None, font=None, background_color=None, text_color=None, key=None, pad=None, tooltip=None, def __init__(self, type, size=(None, None), auto_size_text=None, font=None, background_color=None, text_color=None, key=None, pad=None, tooltip=None,
visible=True, metadata=None, visible=True, metadata=None,
sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_arrow_background_color=None, sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=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):
""" """
Element base class. Only used internally. User will not create an Element object by itself Element base class. Only used internally. User will not create an Element object by itself
@ -1034,7 +1035,22 @@ class Element():
:type visible: (bool) :type visible: (bool)
:param metadata: User metadata that can be set to ANYTHING :param metadata: User metadata that can be set to ANYTHING
:type metadata: (Any) :type metadata: (Any)
:param sbar_trough_color: Scrollbar color of the trough
:type sbar_trough_color: (str)
:param sbar_background_color: Scrollbar color of the background of the arrow buttons at the ends AND the color of the "thumb" (the thing you grab and slide). Switches to arrow color when mouse is over
:type sbar_background_color: (str)
:param sbar_arrow_color: Scrollbar color of the arrow at the ends of the scrollbar (it looks like a button). Switches to background color when mouse is over
:type sbar_arrow_color: (str)
:param sbar_width: Scrollbar width in pixels
:type sbar_width: (int)
:param sbar_arrow_width: Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar
:type sbar_arrow_width: (int)
:param sbar_frame_color: Scrollbar Color of frame around scrollbar (available only on some ttk themes)
:type sbar_frame_color: (str)
:param sbar_relief: Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID
:type sbar_relief: (str)
""" """
if size is not None and size != (None, None): if size is not None and size != (None, None):
if isinstance(size, int): if isinstance(size, int):
size = (size, 1) size = (size, 1)
@ -1117,13 +1133,6 @@ class Element():
if callable(self.scroll_arrow_color): if callable(self.scroll_arrow_color):
self.scroll_arrow_color = self.scroll_arrow_color() self.scroll_arrow_color = self.scroll_arrow_color()
if sbar_arrow_background_color is not None:
self.scroll_arrow_background_color = sbar_arrow_background_color
else:
self.scroll_arrow_background_color = PSG_THEME_PART_FUNC_MAP.get(ttk_part_mapping_dict[TTK_SCROLLBAR_PART_ARROW_BUTTON_BACKGROUND_COLOR], ttk_part_mapping_dict[TTK_SCROLLBAR_PART_ARROW_BUTTON_BACKGROUND_COLOR])
if callable(self.scroll_arrow_background_color):
self.scroll_arrow_background_color = self.scroll_arrow_background_color()
if sbar_frame_color is not None: if sbar_frame_color is not None:
self.scroll_frame_color = sbar_frame_color self.scroll_frame_color = sbar_frame_color
@ -2487,8 +2496,7 @@ class Listbox(Element):
def __init__(self, values, default_values=None, select_mode=None, change_submits=False, enable_events=False, def __init__(self, values, default_values=None, select_mode=None, change_submits=False, enable_events=False,
bind_return_key=False, size=(None, None), s=(None, None), disabled=False, auto_size_text=None, font=None, no_scrollbar=False, horizontal_scroll=False, bind_return_key=False, size=(None, None), s=(None, None), disabled=False, auto_size_text=None, font=None, no_scrollbar=False, horizontal_scroll=False,
background_color=None, text_color=None, highlight_background_color=None, highlight_text_color=None, background_color=None, text_color=None, highlight_background_color=None, highlight_text_color=None,
sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_arrow_background_color=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,
sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=None,
key=None, k=None, pad=None, p=None, tooltip=None, expand_x=False, expand_y=False,right_click_menu=None, visible=True, metadata=None): key=None, k=None, pad=None, p=None, tooltip=None, expand_x=False, expand_y=False,right_click_menu=None, visible=True, metadata=None):
""" """
:param values: list of values to display. Can be any type including mixed types as long as they have __str__ method :param values: list of values to display. Can be any type including mixed types as long as they have __str__ method
@ -2525,6 +2533,20 @@ class Listbox(Element):
:type highlight_background_color: (str) :type highlight_background_color: (str)
:param highlight_text_color: color of the text when an item is selected. Defaults to the normal background color (a rerverse look) :param highlight_text_color: color of the text when an item is selected. Defaults to the normal background color (a rerverse look)
:type highlight_text_color: (str) :type highlight_text_color: (str)
:param sbar_trough_color: Scrollbar color of the trough
:type sbar_trough_color: (str)
:param sbar_background_color: Scrollbar color of the background of the arrow buttons at the ends AND the color of the "thumb" (the thing you grab and slide). Switches to arrow color when mouse is over
:type sbar_background_color: (str)
:param sbar_arrow_color: Scrollbar color of the arrow at the ends of the scrollbar (it looks like a button). Switches to background color when mouse is over
:type sbar_arrow_color: (str)
:param sbar_width: Scrollbar width in pixels
:type sbar_width: (int)
:param sbar_arrow_width: Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar
:type sbar_arrow_width: (int)
:param sbar_frame_color: Scrollbar Color of frame around scrollbar (available only on some ttk themes)
:type sbar_frame_color: (str)
:param sbar_relief: Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID
:type sbar_relief: (str)
:param key: Used with window.find_element and with return values to uniquely identify this element :param key: Used with window.find_element and with return values to uniquely identify this element
:type key: str | int | tuple | object :type key: str | int | tuple | object
:param k: Same as the Key. You can use either k or key. Which ever is set will be used. :param k: Same as the Key. You can use either k or key. Which ever is set will be used.
@ -2582,7 +2604,7 @@ class Listbox(Element):
super().__init__(ELEM_TYPE_INPUT_LISTBOX, size=sz, auto_size_text=auto_size_text, font=font, super().__init__(ELEM_TYPE_INPUT_LISTBOX, size=sz, auto_size_text=auto_size_text, font=font,
background_color=bg, text_color=fg, key=key, pad=pad, tooltip=tooltip, visible=visible, metadata=metadata, background_color=bg, text_color=fg, key=key, pad=pad, tooltip=tooltip, visible=visible, metadata=metadata,
sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_arrow_background_color=sbar_arrow_background_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief) sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief)
def update(self, values=None, disabled=None, set_to_index=None, scroll_to_index=None, select_mode=None, visible=None): def update(self, values=None, disabled=None, set_to_index=None, scroll_to_index=None, select_mode=None, visible=None):
""" """
@ -3303,7 +3325,7 @@ class Multiline(Element):
def __init__(self, default_text='', enter_submits=False, disabled=False, autoscroll=False, border_width=None, def __init__(self, default_text='', enter_submits=False, disabled=False, autoscroll=False, border_width=None,
size=(None, None), s=(None, None), auto_size_text=None, background_color=None, text_color=None, horizontal_scroll=False, change_submits=False, size=(None, None), s=(None, None), auto_size_text=None, background_color=None, text_color=None, horizontal_scroll=False, change_submits=False,
enable_events=False, do_not_clear=True, key=None, k=None, write_only=False, auto_refresh=False, reroute_stdout=False, reroute_stderr=False, reroute_cprint=False, echo_stdout_stderr=False, focus=False, font=None, pad=None, p=None, tooltip=None, justification=None, no_scrollbar=False, enable_events=False, do_not_clear=True, key=None, k=None, write_only=False, auto_refresh=False, reroute_stdout=False, reroute_stderr=False, reroute_cprint=False, echo_stdout_stderr=False, focus=False, font=None, pad=None, p=None, tooltip=None, justification=None, no_scrollbar=False,
sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_arrow_background_color=None, sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=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,
expand_x=False, expand_y=False, rstrip=True, right_click_menu=None, visible=True, metadata=None): expand_x=False, expand_y=False, rstrip=True, right_click_menu=None, visible=True, metadata=None):
""" """
:param default_text: Initial text to show :param default_text: Initial text to show
@ -3366,19 +3388,17 @@ class Multiline(Element):
:type no_scrollbar: (bool) :type no_scrollbar: (bool)
:param sbar_trough_color: Scrollbar color of the trough :param sbar_trough_color: Scrollbar color of the trough
:type sbar_trough_color: (str) :type sbar_trough_color: (str)
:param sbar_background_color: Scrollbar :param sbar_background_color: Scrollbar color of the background of the arrow buttons at the ends AND the color of the "thumb" (the thing you grab and slide). Switches to arrow color when mouse is over
:type sbar_background_color: (str) :type sbar_background_color: (str)
:param sbar_arrow_color: Scrollbar :param sbar_arrow_color: Scrollbar color of the arrow at the ends of the scrollbar (it looks like a button). Switches to background color when mouse is over
:type sbar_arrow_color: (str) :type sbar_arrow_color: (str)
:param sbar_arrow_background_color: Scrollbar :param sbar_width: Scrollbar width in pixels
:type sbar_arrow_background_color: (str)
:param sbar_width: Scrollbar
:type sbar_width: (int) :type sbar_width: (int)
:param sbar_arrow_width: Scrollbar :param sbar_arrow_width: Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar
:type sbar_arrow_width: (int) :type sbar_arrow_width: (int)
:param sbar_frame_color: Scrollbar :param sbar_frame_color: Scrollbar Color of frame around scrollbar (available only on some ttk themes)
:type sbar_frame_color: (str) :type sbar_frame_color: (str)
:param sbar_relief: Scrollbar :param sbar_relief: Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID
:type sbar_relief: (str) :type sbar_relief: (str)
:param expand_x: If True the element will automatically expand in the X direction to fill available space :param expand_x: If True the element will automatically expand in the X direction to fill available space
:type expand_x: (bool) :type expand_x: (bool)
@ -3434,7 +3454,7 @@ class Multiline(Element):
super().__init__(ELEM_TYPE_INPUT_MULTILINE, size=sz, auto_size_text=auto_size_text, background_color=bg, super().__init__(ELEM_TYPE_INPUT_MULTILINE, size=sz, auto_size_text=auto_size_text, background_color=bg,
text_color=fg, key=key, pad=pad, tooltip=tooltip, font=font or DEFAULT_FONT, visible=visible, metadata=metadata, text_color=fg, key=key, pad=pad, tooltip=tooltip, font=font or DEFAULT_FONT, visible=visible, metadata=metadata,
sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_arrow_background_color=sbar_arrow_background_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief) sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief)
return return
def update(self, value=None, disabled=None, append=False, font=None, text_color=None, background_color=None, text_color_for_value=None, def update(self, value=None, disabled=None, append=False, font=None, text_color=None, background_color=None, text_color_for_value=None,
@ -3734,7 +3754,7 @@ class Text(Element):
:type click_submits: (bool) :type click_submits: (bool)
:param enable_events: Turns on the element specific events. Text events happen when the text is clicked :param enable_events: Turns on the element specific events. Text events happen when the text is clicked
:type enable_events: (bool) :type enable_events: (bool)
:param relief: relief style around the text. Values are same as progress meter relief values. Should be a constant that is defined at starting with "RELIEF_" - `RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID` :param relief: relief style around the text. Values are same as progress meter relief values. Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID
:type relief: (str/enum) :type relief: (str/enum)
:param font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike :param font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
:type font: (str or (str, int[, str]) or None) :type font: (str or (str, int[, str]) or None)
@ -4401,7 +4421,8 @@ class Output(Multiline):
""" """
def __init__(self, size=(None, None), s=(None, None), background_color=None, text_color=None, pad=None, p=None, echo_stdout_stderr=False, font=None, tooltip=None, def __init__(self, size=(None, None), s=(None, None), background_color=None, text_color=None, pad=None, p=None, echo_stdout_stderr=False, font=None, tooltip=None,
key=None, k=None, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None): key=None, k=None, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=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):
""" """
:param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1 :param size: (w, h) w=characters-wide, h=rows-high. If an int instead of a tuple is supplied, then height is auto-set to 1
:type size: (int, int) | (None, None) | int :type size: (int, int) | (None, None) | int
@ -4435,8 +4456,23 @@ class Output(Multiline):
:type visible: (bool) :type visible: (bool)
:param metadata: User metadata that can be set to ANYTHING :param metadata: User metadata that can be set to ANYTHING
:type metadata: (Any) :type metadata: (Any)
:param sbar_trough_color: Scrollbar color of the trough
:type sbar_trough_color: (str)
:param sbar_background_color: Scrollbar color of the background of the arrow buttons at the ends AND the color of the "thumb" (the thing you grab and slide). Switches to arrow color when mouse is over
:type sbar_background_color: (str)
:param sbar_arrow_color: Scrollbar color of the arrow at the ends of the scrollbar (it looks like a button). Switches to background color when mouse is over
:type sbar_arrow_color: (str)
:param sbar_width: Scrollbar width in pixels
:type sbar_width: (int)
:param sbar_arrow_width: Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar
:type sbar_arrow_width: (int)
:param sbar_frame_color: Scrollbar Color of frame around scrollbar (available only on some ttk themes)
:type sbar_frame_color: (str)
:param sbar_relief: Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID
:type sbar_relief: (str)
""" """
# self._TKOut = self.Widget = None # type: TKOutput # self._TKOut = self.Widget = None # type: TKOutput
# bg = background_color if background_color else DEFAULT_INPUT_ELEMENTS_COLOR # bg = background_color if background_color else DEFAULT_INPUT_ELEMENTS_COLOR
# fg = text_color if text_color is not None else DEFAULT_INPUT_TEXT_COLOR # fg = text_color if text_color is not None else DEFAULT_INPUT_TEXT_COLOR
@ -4449,7 +4485,8 @@ class Output(Multiline):
# self.expand_y = expand_y # self.expand_y = expand_y
super().__init__(size=size, s=s, background_color=background_color, text_color=text_color, pad=pad, p=p, echo_stdout_stderr=echo_stdout_stderr, font=font, tooltip=tooltip, super().__init__(size=size, s=s, background_color=background_color, text_color=text_color, pad=pad, p=p, echo_stdout_stderr=echo_stdout_stderr, font=font, tooltip=tooltip,
key=key, k=k, right_click_menu=right_click_menu, write_only=True, reroute_stdout=True, reroute_stderr=True, autoscroll=True, expand_x=expand_x, expand_y=expand_y, visible=visible, metadata=metadata) key=key, k=k, right_click_menu=right_click_menu, write_only=True, reroute_stdout=True, reroute_stderr=True, autoscroll=True, expand_x=expand_x, expand_y=expand_y, visible=visible, metadata=metadata,
sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief)
# #
# @property # @property
# def tk_out(self): # def tk_out(self):
@ -7784,7 +7821,9 @@ class Column(Element):
def __init__(self, layout, background_color=None, size=(None, None), s=(None, None), pad=None, p=None, scrollable=False, def __init__(self, layout, background_color=None, size=(None, None), s=(None, None), pad=None, p=None, scrollable=False,
vertical_scroll_only=False, right_click_menu=None, key=None, k=None, visible=True, justification=None, element_justification=None, vertical_scroll_only=False, right_click_menu=None, key=None, k=None, visible=True, justification=None, element_justification=None,
vertical_alignment=None, grab=None, expand_x=None, expand_y=None, metadata=None): vertical_alignment=None, grab=None, expand_x=None, expand_y=None, metadata=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):
""" """
:param layout: Layout that will be shown in the Column container :param layout: Layout that will be shown in the Column container
:type layout: List[List[Element]] :type layout: List[List[Element]]
@ -7824,8 +7863,23 @@ class Column(Element):
:type expand_y: (bool) :type expand_y: (bool)
:param metadata: User metadata that can be set to ANYTHING :param metadata: User metadata that can be set to ANYTHING
:type metadata: (Any) :type metadata: (Any)
:param sbar_trough_color: Scrollbar color of the trough
:type sbar_trough_color: (str)
:param sbar_background_color: Scrollbar color of the background of the arrow buttons at the ends AND the color of the "thumb" (the thing you grab and slide). Switches to arrow color when mouse is over
:type sbar_background_color: (str)
:param sbar_arrow_color: Scrollbar color of the arrow at the ends of the scrollbar (it looks like a button). Switches to background color when mouse is over
:type sbar_arrow_color: (str)
:param sbar_width: Scrollbar width in pixels
:type sbar_width: (int)
:param sbar_arrow_width: Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar
:type sbar_arrow_width: (int)
:param sbar_frame_color: Scrollbar Color of frame around scrollbar (available only on some ttk themes)
:type sbar_frame_color: (str)
:param sbar_relief: Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID
:type sbar_relief: (str)
""" """
self.UseDictionary = False self.UseDictionary = False
self.ReturnValues = None self.ReturnValues = None
self.ReturnValuesList = [] self.ReturnValuesList = []
@ -7853,7 +7907,8 @@ class Column(Element):
sz = size if size != (None, None) else s sz = size if size != (None, None) else s
pad = pad if pad is not None else p pad = pad if pad is not None else p
super().__init__(ELEM_TYPE_COLUMN, background_color=bg, size=sz, pad=pad, key=key, visible=visible, metadata=metadata) super().__init__(ELEM_TYPE_COLUMN, background_color=bg, size=sz, pad=pad, key=key, visible=visible, metadata=metadata,
sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief)
return return
def add_row(self, *args): def add_row(self, *args):
@ -8488,8 +8543,7 @@ class Table(Element):
row_height=None, font=None, justification='right', text_color=None, background_color=None, row_height=None, font=None, justification='right', text_color=None, background_color=None,
alternating_row_color=None, selected_row_colors=(None, None), header_text_color=None, header_background_color=None, header_font=None, header_border_width=None, header_relief=None, alternating_row_color=None, selected_row_colors=(None, None), header_text_color=None, header_background_color=None, header_font=None, header_border_width=None, header_relief=None,
row_colors=None, vertical_scroll_only=True, hide_vertical_scroll=False, border_width=None, row_colors=None, vertical_scroll_only=True, hide_vertical_scroll=False, border_width=None,
sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_arrow_background_color=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,
sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=None,
size=(None, None), s=(None, None), change_submits=False, enable_events=False, enable_click_events=False, right_click_selects=False, bind_return_key=False, pad=None, p=None, size=(None, None), s=(None, None), change_submits=False, enable_events=False, enable_click_events=False, right_click_selects=False, bind_return_key=False, pad=None, p=None,
key=None, k=None, tooltip=None, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None): key=None, k=None, tooltip=None, right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None):
""" """
@ -8547,19 +8601,17 @@ class Table(Element):
:type border_width: (int) :type border_width: (int)
:param sbar_trough_color: Scrollbar color of the trough :param sbar_trough_color: Scrollbar color of the trough
:type sbar_trough_color: (str) :type sbar_trough_color: (str)
:param sbar_background_color: Scrollbar :param sbar_background_color: Scrollbar color of the background of the arrow buttons at the ends AND the color of the "thumb" (the thing you grab and slide). Switches to arrow color when mouse is over
:type sbar_background_color: (str) :type sbar_background_color: (str)
:param sbar_arrow_color: Scrollbar :param sbar_arrow_color: Scrollbar color of the arrow at the ends of the scrollbar (it looks like a button). Switches to background color when mouse is over
:type sbar_arrow_color: (str) :type sbar_arrow_color: (str)
:param sbar_arrow_background_color: Scrollbar :param sbar_width: Scrollbar width in pixels
:type sbar_arrow_background_color: (str)
:param sbar_width: Scrollbar
:type sbar_width: (int) :type sbar_width: (int)
:param sbar_arrow_width: Scrollbar :param sbar_arrow_width: Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar
:type sbar_arrow_width: (int) :type sbar_arrow_width: (int)
:param sbar_frame_color: Scrollbar :param sbar_frame_color: Scrollbar Color of frame around scrollbar (available only on some ttk themes)
:type sbar_frame_color: (str) :type sbar_frame_color: (str)
:param sbar_relief: Scrollbar :param sbar_relief: Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID
:type sbar_relief: (str) :type sbar_relief: (str)
:param size: DO NOT USE! Use num_rows instead :param size: DO NOT USE! Use num_rows instead
:type size: (int, int) :type size: (int, int)
@ -8651,7 +8703,7 @@ class Table(Element):
super().__init__(ELEM_TYPE_TABLE, text_color=text_color, background_color=background_color, font=font, super().__init__(ELEM_TYPE_TABLE, text_color=text_color, background_color=background_color, font=font,
size=sz, pad=pad, key=key, tooltip=tooltip, visible=visible, metadata=metadata, size=sz, pad=pad, key=key, tooltip=tooltip, visible=visible, metadata=metadata,
sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_arrow_background_color=sbar_arrow_background_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief) sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief)
return return
def update(self, values=None, num_rows=None, visible=None, select_rows=None, alternating_row_color=None, row_colors=None): def update(self, values=None, num_rows=None, visible=None, select_rows=None, alternating_row_color=None, row_colors=None):
@ -8876,8 +8928,7 @@ class Tree(Element):
def_col_width=10, auto_size_columns=True, max_col_width=20, select_mode=None, show_expanded=False, def_col_width=10, auto_size_columns=True, max_col_width=20, select_mode=None, show_expanded=False,
change_submits=False, enable_events=False, font=None, justification='right', text_color=None, border_width=None, change_submits=False, enable_events=False, font=None, justification='right', text_color=None, border_width=None,
background_color=None, selected_row_colors=(None, None), header_text_color=None, header_background_color=None, header_font=None, header_border_width=None, header_relief=None, num_rows=None, background_color=None, selected_row_colors=(None, None), header_text_color=None, header_background_color=None, header_font=None, header_border_width=None, header_relief=None, num_rows=None,
sbar_trough_color=None, sbar_background_color=None, sbar_arrow_color=None, sbar_arrow_background_color=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,
sbar_width=None, sbar_arrow_width=None, sbar_frame_color=None, sbar_relief=None,
row_height=None, vertical_scroll_only=True, hide_vertical_scroll=False, pad=None, p=None, key=None, k=None, tooltip=None, row_height=None, vertical_scroll_only=True, hide_vertical_scroll=False, pad=None, p=None, key=None, k=None, tooltip=None,
right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None): right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None):
""" """
@ -8939,19 +8990,17 @@ class Tree(Element):
:type hide_vertical_scroll: (bool) :type hide_vertical_scroll: (bool)
:param sbar_trough_color: Scrollbar color of the trough :param sbar_trough_color: Scrollbar color of the trough
:type sbar_trough_color: (str) :type sbar_trough_color: (str)
:param sbar_background_color: Scrollbar :param sbar_background_color: Scrollbar color of the background of the arrow buttons at the ends AND the color of the "thumb" (the thing you grab and slide). Switches to arrow color when mouse is over
:type sbar_background_color: (str) :type sbar_background_color: (str)
:param sbar_arrow_color: Scrollbar :param sbar_arrow_color: Scrollbar color of the arrow at the ends of the scrollbar (it looks like a button). Switches to background color when mouse is over
:type sbar_arrow_color: (str) :type sbar_arrow_color: (str)
:param sbar_arrow_background_color: Scrollbar :param sbar_width: Scrollbar width in pixels
:type sbar_arrow_background_color: (str)
:param sbar_width: Scrollbar
:type sbar_width: (int) :type sbar_width: (int)
:param sbar_arrow_width: Scrollbar :param sbar_arrow_width: Scrollbar width of the arrow on the scrollbar. It will potentially impact the overall width of the scrollbar
:type sbar_arrow_width: (int) :type sbar_arrow_width: (int)
:param sbar_frame_color: Scrollbar :param sbar_frame_color: Scrollbar Color of frame around scrollbar (available only on some ttk themes)
:type sbar_frame_color: (str) :type sbar_frame_color: (str)
:param sbar_relief: Scrollbar :param sbar_relief: Scrollbar relief that will be used for the "thumb" of the scrollbar (the thing you grab that slides). Should be a constant that is defined at starting with "RELIEF_" - RELIEF_RAISED, RELIEF_SUNKEN, RELIEF_FLAT, RELIEF_RIDGE, RELIEF_GROOVE, RELIEF_SOLID
:type sbar_relief: (str) :type sbar_relief: (str)
:param pad: 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) :param pad: 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)
:type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | int :type pad: (int, int) or ((int, int),(int,int)) or (int,(int,int)) or ((int, int),int) | int
@ -9029,7 +9078,7 @@ class Tree(Element):
super().__init__(ELEM_TYPE_TREE, text_color=text_color, background_color=background_color, font=font, pad=pad, key=key, tooltip=tooltip, super().__init__(ELEM_TYPE_TREE, text_color=text_color, background_color=background_color, font=font, pad=pad, key=key, tooltip=tooltip,
visible=visible, metadata=metadata, visible=visible, metadata=metadata,
sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_arrow_background_color=sbar_arrow_background_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief) sbar_trough_color=sbar_trough_color, sbar_background_color=sbar_background_color, sbar_arrow_color=sbar_arrow_color, sbar_width=sbar_width, sbar_arrow_width=sbar_arrow_width, sbar_frame_color=sbar_frame_color, sbar_relief=sbar_relief)
return return
def _treeview_selected(self, event): def _treeview_selected(self, event):
@ -14500,7 +14549,7 @@ def _make_ttk_scrollbar(element, orientation, window):
style.map(style_name, background=[("selected", element.scroll_background_color), ('active', element.scroll_arrow_color), ('background', element.scroll_background_color), ('!focus', element.scroll_background_color)]) style.map(style_name, background=[("selected", element.scroll_background_color), ('active', element.scroll_arrow_color), ('background', element.scroll_background_color), ('!focus', element.scroll_background_color)])
if (element.scroll_background_color not in (None, COLOR_SYSTEM_DEFAULT)) and \ if (element.scroll_background_color not in (None, COLOR_SYSTEM_DEFAULT)) and \
(element.scroll_arrow_color not in (None, COLOR_SYSTEM_DEFAULT)): (element.scroll_arrow_color not in (None, COLOR_SYSTEM_DEFAULT)):
style.map(style_name, arrowcolor=[("selected", element.scroll_arrow_color), ('active', element.scroll_background_color), ('background', element.scroll_arrow_color),('!focus', element.scroll_arrow_color)]) style.map(style_name, arrowcolor=[("selected", element.scroll_arrow_color), ('active', element.scroll_background_color), ('background', element.scroll_background_color),('!focus', element.scroll_arrow_color)])
# if __name__ == '__main__': # if __name__ == '__main__':
# root = tk.Tk() # root = tk.Tk()