Release 4.58.0

This commit is contained in:
PySimpleGUI 2022-04-04 17:11:28 -04:00
parent 07bb93d47f
commit b04252a864
7 changed files with 582 additions and 270 deletions

View File

@ -1,87 +1,10 @@
#!/usr/bin/python3
version = __version__ = "4.57.0.31 Unreleased"
version = __version__ = "4.58.0 Released 4-Apr-2022"
_change_log = """
Changelog since 4.57.0 released to PyPI on 13-Feb-2022
Changelog since 4.58.0 released to PyPI on 4-Apr-2022
4.57.0.1
Added checking for timeout error to execute_get_results instead of showing an error popup as it's not truly an error in this case
4.57.0.2
Added cast to bool of default parm for Checkbox element in case user passes in an incorrect type
4.57.0.3
Coupon... for 30 days this time....
4.57.0.4
ButtonMenu.update - addition of button_text parameter. Enables changing text displayed on the ButtonMenu. Should have been an original feature.
4.57.0.5
Open GitHub Issue GUI - Tabs use 2 lines now. Added tab asking where found PSG.
4.57.0.6
New symbols SYMBOL_CHECKMARK_SMALL & SYMBOL_X_SMALL
4.57.0.7
Added click - PEP8 alias for ButtonMenu.Click
4.57.0.8
Automatically add timeouts to user reads if a debugger window is opened. Need to add support for multi-window applications still.
4.57.0.9
start_thread - a simple alias for perform_long_operation. It's clearer what's happening with this alias.
Added bind_return_key to Spin element. If element has focus and the return key is pressed, then an event is generated.
4.57.0.10
If an element is disabled, then don't generate events (fixed specifically for Input element)
4.57.0.11
Added event generation back for disabled elements if the event was a browse button filling in the element
4.57.0.12
Don't generate events if no files / folders selected using File or Folder Browse buttons. If cancel is clicked then no longer generates an event.
4.57.0.13
Fix docstring for image in the Titlebar element. Incorrectly said an ICO file can be used. Must be PNG or GIF
4.57.0.14
Windows-specific code that enables the PySimpleGUI supplied icon to be shown rather than the python.exe logo (thank you Jason)
4.57.0.15
Removed all temporary Tk() window creation and instead create the hidden master root. These were required for operations like getting
the list of fonts from tkinter, the screensize, character width and height. This way one and only one Tk window will ever be creeated.
The reason for the change is that the Mac crashes if multiple Tk() objects are created, even if only 1 at a time is active.
4.57.0.16
Addition of image_source parm to Button. It can be either a filename or a base64 string. This is like the Image elements parms
Graph element doc string improvement. Describes the mouse up event.
4.57.0.17
New coupon code
4.57.0.18
Element.get_next_focus added. Returns the element that should get the focus after the indicated element
Element.get_previous_focus added. Returns the element that should get the focus after the indicated element
Window.widget_to_element - returns the element that a tkinter widget is used to implement (it's a reverse lookup)
Element.widget - Property that's PEP8 compliant that returns Element.Widget
Element.key - Property that's PEP8 compliant that returns Element.Key
Better exception error reporting for the Element focus methods. Uses popups with tracebacks now instead of prints
Simplified docstring for Window[] to show Element and None as return values
4.57.0.19
Oops... added back the rtype docstring for Window __getitem__ so that PyCharm doesn't generate warnings.
Using Element by itself isn't enough. The entire list of possible elements is needed to that the code completion /error checking works
4.57.0.20
Simplified Radio, Checkbox, Slider creation. Moved the command parm outside the creation and instead made a config call.
4.57.0.21
Another coupon code. Udemy makes it difficult by only giving a valid period of 5 days for some coupons
4.57.0.22
Another coupon - changed base price
4.57.0.23
Fix for expand and other settings being lost when element is made invisible and visible again.
Not ALL elements have been converted over to handle correctly... checking in to get the ball rolling and will complete the others today
So far Text, Input, Multiline, Frame, Statusbar, Combo are done
4.57.0.24
Fixed crach in the update method for Text element when making inivisible
4.57.0.25
Added propagate parameter to the bind methods. Used to tell tkinter whether or not to propagate the event to the element / or window (thank you Jason!)
4.57.0.26
Completed the new way of saving the element's settings for visible/invisible. Was losing expand and other settings. Now all elements use this new scheme
4.57.0.27
Fixed bug in Tree and Table elements when using visible in the layout
Added an update method to Canvas
4.57.0.28
Fixed bug in new pack_forget code. If the element has already been made invisible then can't attempt the operation again because the pack_info call will crash
Removed the need for tk.scrolledtext.ScrolledText by adding a vertical scrollbar to a Text widget. Getting ready for addtion of ttk scrollbars!
4.57.0.29
Backed out changes accidently checked in that will crash on Linux (DOH! SORRY!!!)
4.57.0.30
Withdraw window during creation in addition to setting alpha to 0
4.57.0.31
Added tooltip_offset parameter to set_options as a way to hack around the 8.6.12 problem of missing events following a tooltip
"""
__version__ = version.split()[0] # For PEP 396 and PEP 345
@ -629,7 +552,7 @@ TEXT_LOCATION_BOTTOM_LEFT = tk.SW
TEXT_LOCATION_BOTTOM_RIGHT = tk.SE
TEXT_LOCATION_CENTER = tk.CENTER
GRAB_ANYWHERE_IGNORE_THESE_WIDGETS = (ttk.Sizegrip, tk.Scale, ttk.Scrollbar, tk.Scrollbar, tk.Entry, tk.Text, tk.PanedWindow, tk.Listbox, tk.OptionMenu)
GRAB_ANYWHERE_IGNORE_THESE_WIDGETS = (ttk.Sizegrip, tk.Scale, ttk.Scrollbar, tk.Scrollbar, tk.Entry, tk.Text, tk.PanedWindow, tk.Listbox, tk.OptionMenu, ttk.Treeview)
# ----====----====----==== Constants the user should NOT f-with ====----====----====----#
ThisRow = 555666777 # magic number
@ -8298,8 +8221,8 @@ class Table(Element):
def __init__(self, values, headings=None, visible_column_map=None, col_widths=None, def_col_width=10,
auto_size_columns=True, max_col_width=20, select_mode=None, display_row_numbers=False, num_rows=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,
row_colors=None, vertical_scroll_only=True, hide_vertical_scroll=False,
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,
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):
"""
@ -8343,12 +8266,18 @@ class Table(Element):
:type header_background_color: (str)
:param header_font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
:type header_font: (str or (str, int[, str]) or None)
:param header_border_width: Border width for the header portion
:type header_border_width: (int | None)
:param header_relief: Relief style for the header. Values are same as other elements that use relief. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID
:type header_relief: (str | None)
:param row_colors: list of tuples of (row, background color) OR (row, foreground color, background color). Sets the colors of listed rows to the color(s) provided (note the optional foreground color)
:type row_colors: List[Tuple[int, str] | Tuple[Int, str, str]]
:param vertical_scroll_only: if True only the vertical scrollbar will be visible
:type vertical_scroll_only: (bool)
:param hide_vertical_scroll: if True vertical scrollbar will be hidden
:type hide_vertical_scroll: (bool)
:param border_width: Border width/depth in pixels
:type border_width: (int)
:param size: DO NOT USE! Use num_rows instead
:type size: (int, int)
:param change_submits: DO NOT USE. Only listed for backwards compat - Use enable_events instead
@ -8414,6 +8343,9 @@ class Table(Element):
self.enable_click_events = enable_click_events
self.right_click_selects = right_click_selects
self.last_clicked_position = (None, None)
self.HeaderBorderWidth = header_border_width
self.BorderWidth = border_width
self.HeaderRelief = header_relief
if selected_row_colors == (None, None):
# selected_row_colors = DEFAULT_TABLE_AND_TREE_SELECTED_ROW_COLORS
selected_row_colors = theme_button_color()
@ -8658,8 +8590,8 @@ class Tree(Element):
def __init__(self, data=None, headings=None, visible_column_map=None, col_widths=None, col0_width=10, col0_heading='',
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,
background_color=None, selected_row_colors=(None, None), header_text_color=None, header_background_color=None, header_font=None, num_rows=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,
row_height=None, pad=None, p=None, key=None, k=None, tooltip=None,
right_click_menu=None, expand_x=False, expand_y=False, visible=True, metadata=None):
"""
@ -8695,6 +8627,8 @@ class Tree(Element):
:type justification: (str)
:param text_color: color of the text
:type text_color: (str)
:param border_width: Border width/depth in pixels
:type border_width: (int)
:param background_color: color of background
:type background_color: (str)
:param selected_row_colors: Sets the text color and background color for a selected row. Same format as button colors - tuple ('red', 'yellow') or string 'red on yellow'. Defaults to theme's button color
@ -8705,6 +8639,10 @@ class Tree(Element):
:type header_background_color: (str)
:param header_font: specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike
:type header_font: (str or (str, int[, str]) or None)
:param header_border_width: Border width for the header portion
:type header_border_width: (int | None)
:param header_relief: Relief style for the header. Values are same as other elements that use relief. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID
:type header_relief: (str | None)
:param num_rows: The number of rows of the table to display at a time
:type num_rows: (int)
:param row_height: height of a single row in pixels
@ -8744,6 +8682,9 @@ class Tree(Element):
self.TextColor = text_color
self.HeaderTextColor = header_text_color if header_text_color is not None else LOOK_AND_FEEL_TABLE[CURRENT_LOOK_AND_FEEL]['TEXT_INPUT']
self.HeaderBackgroundColor = header_background_color if header_background_color is not None else LOOK_AND_FEEL_TABLE[CURRENT_LOOK_AND_FEEL]['INPUT']
self.HeaderBorderWidth = header_border_width
self.BorderWidth = border_width
self.HeaderRelief = header_relief
if selected_row_colors == (None, None):
# selected_row_colors = DEFAULT_TABLE_AND_TREE_SELECTED_ROW_COLORS
@ -15827,7 +15768,13 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
table_style.configure(style_name + '.Heading', font=element.HeaderFont)
else:
table_style.configure(style_name + '.Heading', font=font)
if element.HeaderBorderWidth is not None:
table_style.configure(style_name + '.Heading', borderwidth=element.HeaderBorderWidth)
if element.HeaderRelief is not None:
table_style.configure(style_name + '.Heading', relief=element.HeaderRelief)
table_style.configure(style_name, font=font)
if element.BorderWidth is not None:
table_style.configure(style_name, borderwidth=element.BorderWidth)
treeview.configure(style=style_name)
# scrollable_frame.pack(side=tk.LEFT, padx=elementpad[0], pady=elementpad[1], expand=True, fill='both')
if element.enable_click_events is True:
@ -15976,11 +15923,18 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
tree_style.configure(style_name + '.Heading', font=element.HeaderFont)
else:
tree_style.configure(style_name + '.Heading', font=font)
if element.HeaderBorderWidth is not None:
tree_style.configure(style_name + '.Heading', borderwidth=element.HeaderBorderWidth)
if element.HeaderRelief is not None:
tree_style.configure(style_name + '.Heading', relief=element.HeaderRelief)
tree_style.configure(style_name, font=font)
if element.RowHeight:
tree_style.configure(style_name, rowheight=element.RowHeight)
else:
tree_style.configure(style_name, rowheight=_char_height_in_pixels(font))
if element.BorderWidth is not None:
tree_style.configure(style_name, borderwidth=element.BorderWidth)
treeview.configure(style=style_name) # IMPORTANT! Be sure and set the style name for this widget
element.scrollbar = scrollbar = tk.Scrollbar(element_frame)
scrollbar.pack(side=tk.RIGHT, fill='y')
@ -23599,12 +23553,12 @@ def _create_main_window():
frame5 = [[
Table(values=matrix, headings=matrix[0],
auto_size_columns=False, display_row_numbers=True, change_submits=False, justification='right',
auto_size_columns=False, display_row_numbers=True, change_submits=False, justification='right', header_border_width=4, header_relief=RELIEF_GROOVE,
num_rows=10, alternating_row_color='lightblue', key='-TABLE-',
col_widths=[5, 5, 5, 5], size=(400, 200), ),
col_widths=[5, 5, 5, 5], size=(400, 200)),
T(' '),
Tree(data=treedata, headings=['col1', 'col2', 'col3'], change_submits=True, auto_size_columns=True,
num_rows=10, col0_width=10, key='-TREE-', show_expanded=True, )],[VStretch()]]
Tree(data=treedata, headings=['col1', 'col2', 'col3'], change_submits=True, auto_size_columns=True, header_border_width=4, header_relief=RELIEF_GROOVE,
num_rows=10, col0_width=10, key='-TREE-', show_expanded=True )],[VStretch()]]
frame7 = [[Image(EMOJI_BASE64_HAPPY_HEARTS, enable_events=True, k='-EMOJI-HEARTS-'), T('Do you'), Image(HEART_3D_BASE64, subsample=3, enable_events=True, k='-HEART-'), T('so far?')],
[T('Want to be taught PySimpleGUI? Then maybe the "Official PySimpleGUI Course" on Udemy is for you.')],
[T('Coupon codes are sometimes around so check docs, announcements, easter eggs on this page, to see specials.')],
@ -23696,7 +23650,7 @@ def _create_main_window():
finalize=True,
grab_anywhere=True,
enable_close_attempted_event=True,
# ttk_theme=THEME_ALT,
ttk_theme=THEME_ALT,
# icon=PSG_DEBUGGER_LOGO,
# icon=PSGDebugLogo,
)

View File

@ -157,7 +157,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -166,6 +168,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -620,7 +623,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -629,6 +634,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -1003,7 +1009,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -1012,6 +1020,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -1339,7 +1348,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -1348,6 +1359,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -1758,7 +1770,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -1767,6 +1781,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -2197,7 +2212,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -2206,6 +2223,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -2636,7 +2654,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -2645,6 +2665,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -3074,7 +3095,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -3083,6 +3106,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -4092,7 +4116,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -4101,6 +4127,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -4411,7 +4438,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -4420,6 +4449,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -4862,7 +4892,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -4871,6 +4903,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -5304,7 +5337,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -5313,6 +5348,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -5779,7 +5815,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -5788,6 +5826,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -6223,7 +6262,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -6232,6 +6273,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -6743,7 +6785,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -6752,6 +6796,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -7139,7 +7184,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -7148,6 +7195,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -7541,7 +7589,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -7550,6 +7600,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -7902,7 +7953,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -7911,6 +7964,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### expand
@ -8337,7 +8391,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -8346,6 +8402,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -8756,7 +8813,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -8765,6 +8824,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### expand
@ -9067,7 +9127,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -9076,6 +9138,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -9448,7 +9511,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -9457,6 +9522,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -9859,7 +9925,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -9868,6 +9936,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -10253,7 +10322,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -10262,6 +10333,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -10712,7 +10784,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -10721,6 +10795,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -11070,9 +11145,12 @@ Table(values,
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,
size = (None, None),
s = (None, None),
change_submits = False,
@ -11116,9 +11194,12 @@ Parameter Descriptions:
| str | header_text_color | sets the text color for the header |
| str | header_background_color | sets the background color for the header |
| (str or (str, int[, str]) or None) | header_font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
| (int or None) | header_border_width | Border width for the header portion |
| (str or None) | header_relief | Relief style for the header. Values are same as other elements that use relief. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
| List[Tuple[int, str] or Tuple[Int, str, str]] | row_colors | list of tuples of (row, background color) OR (row, foreground color, background color). Sets the colors of listed rows to the color(s) provided (note the optional foreground color) |
| bool | vertical_scroll_only | if True only the vertical scrollbar will be visible |
| bool | hide_vertical_scroll | if True vertical scrollbar will be hidden |
| int | border_width | Border width/depth in pixels |
| (int, int) | size | DO NOT USE! Use num_rows instead |
| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
| bool | enable_events | Turns on the element specific events. Table events happen when row is clicked |
@ -11142,7 +11223,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -11151,6 +11234,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -11555,7 +11639,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -11564,6 +11650,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### expand
@ -11963,11 +12050,14 @@ Tree(data = None,
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,
row_height = None,
pad = None,
@ -12002,11 +12092,14 @@ Parameter Descriptions:
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
| str | justification | 'left', 'right', 'center' are valid choices |
| str | text_color | color of the text |
| int | border_width | Border width/depth in pixels |
| str | background_color | color of background |
| str or (str, str) | selected_row_colors | Sets the text color and background color for a selected row. Same format as button colors - tuple ('red', 'yellow') or string 'red on yellow'. Defaults to theme's button color |
| str | header_text_color | sets the text color for the header |
| str | header_background_color | sets the background color for the header |
| (str or (str, int[, str]) or None) | header_font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
| (int or None) | header_border_width | Border width for the header portion |
| (str or None) | header_relief | Relief style for the header. Values are same as other elements that use relief. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
| int | num_rows | The number of rows of the table to display at a time |
| int | row_height | height of a single row in pixels |
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | 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) |
@ -12040,7 +12133,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -12049,6 +12144,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -12480,7 +12576,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -12489,6 +12587,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### expand
@ -12881,7 +12980,9 @@ Used to add tkinter events to a Window.
The tkinter specific data is in the Window's member variable user_bind_event
```
bind(bind_string, key)
bind(bind_string,
key,
propagate = True)
```
Parameter Descriptions:
@ -12890,6 +12991,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str or int or tuple or object | key | The event that will be generated when the tkinter event occurs |
| bool | propagate | If True then tkinter will be told to propagate the event |
### bring_to_front
@ -19360,7 +19462,8 @@ set_options(icon = None,
keep_on_top = None,
dpi_awareness = None,
scaling = None,
disable_modal_windows = None)
disable_modal_windows = None,
tooltip_offset = (None, None))
```
Parameter Descriptions:
@ -19421,6 +19524,7 @@ Parameter Descriptions:
| bool | dpi_awareness | If True then will turn on DPI awareness (Windows only at the moment) |
| float | scaling | Sets the default scaling for all windows including popups, etc. |
| bool | disable_modal_windows | If True then all windows, including popups, will not be modal windows |
| ((None, None) or (int, int)) | tooltip_offset | Offset to use for tooltips as a tuple. These values will be added to the mouse location when the widget was entered. |
| None | **RETURN** | None
### Non PEP8 versions
@ -19492,7 +19596,8 @@ SetOptions(icon = None,
keep_on_top = None,
dpi_awareness = None,
scaling = None,
disable_modal_windows = None)
disable_modal_windows = None,
tooltip_offset = (None, None))
```
Parameter Descriptions:
@ -19553,6 +19658,7 @@ Parameter Descriptions:
| bool | dpi_awareness | If True then will turn on DPI awareness (Windows only at the moment) |
| float | scaling | Sets the default scaling for all windows including popups, etc. |
| bool | disable_modal_windows | If True then all windows, including popups, will not be modal windows |
| ((None, None) or (int, int)) | tooltip_offset | Offset to use for tooltips as a tuple. These values will be added to the mouse location when the widget was entered. |
| None | **RETURN** | None
## Old Themes (Look and Feel) - Replaced by theme()

View File

@ -9879,6 +9879,55 @@ New Emojis for 2022... collect them all!
- Fix for Listbox scrollbar not behaving correctly when making element invisible / visible
- Docstring update for Window.perform_long_operation warns users that Thread are used and thus no PySimpleGUI calls are allowed. Also added description of exactly what happens when the user's function completes.
## 4.58.0 PySimpleGUI 3-Apr-2022
A little of this and that release
More focus on focus
`bind` methods improved with `propagate` parm
Visibility losing settings fix
- `execute_get_results` Added checking for timeout error to instead of showing an error popup as it's not truly an error in this case
- `Checkbox` Added cast to bool of default parm in case user passes in an incorrect type
- `ButtonMenu.update` addition of button_text parameter. Enables changing text displayed on the ButtonMenu. Should have been an original feature.
- Open GitHub Issue GUI Tabs use 2 lines now. Added tab asking where found PSG.
- New symbols `SYMBOL_CHECKMARK_SMALL` & `SYMBOL_X_SMALL`
- `ButtonMenu.Click` - Added click PEP8 alias `ButtonMenu.click`
- Automatically add timeouts to user reads if a debugger window is opened. Debugger for multi-window applications still needs to be added
- `Window.start_thread` a simple alias for `Window.perform_long_operation`. It's clearer what's happening with this alias.
- `bind_return_key` parm added to Spin element. If element has focus and the return key is pressed, then an event is generated.
- Event generation for disabled elements
- If an element is disabled, then don't generate events (fixed specifically for Input element). However, if a Browse button fills in a disabled element, then an event should still be generated
- Don't generate events if no files / folders selected using File or Folder Browse buttons. If cancel is clicked then no longer generates an event.
- Fix docstring for image in the Titlebar element. Incorrectly said an ICO file can be used. Must be PNG or GIF
- Windows-specific code that enables the PySimpleGUI supplied icon to be shown rather than the python.exe logo
- Removed all temporary Tk() window creation calls
- Instead create the hidden master root.
- These were required for operations like getting the list of fonts from tkinter, the screensize, character width and height. This way one and only one Tk window will ever be creeated
- The reason for the change is that the Mac crashes if multiple Tk() objects are created, even if only 1 at a time is active.
- `image_source` parm added to `Button`
- It can be either a filename or a base64 string.
- This is like the Image elements parms
- Graph element doc string improvement. Describes the mouse up event.
- Improved support for focus
- `Element.get_next_focus` added. Returns the element that should get the focus after the indicated element
- `Element.get_previous_focus` added. Returns the element that should get the focus after the indicated element
- Better exception error reporting for the Element focus methods. Uses popups with tracebacks now instead of prints
- `Window.widget_to_element` returns the element that a tkinter widget is used to implement (it's a reverse lookup)
- `Element.widget` added. It's a PEP8 compliant property that returns `Element.Widget`
- `Element.key` added. It's a PEP8 compliant property that returns `Element.Key`
- Simplified Radio, Checkbox, Slider creation. Moved the command parm outside the creation and instead made a config call.
- Visibility fix
- Expand and other settings were being lost when element is made invisible and visible again.
- `propagate` parameter to the bind methods. Used to tell tkinter whether or not to propagate the event to the element / or window
- `Canvas.update` method added so that a `Canvas` can be made visible/invisible
- Removed the need for `tk.scrolledtext.ScrolledText` by adding a vertical scrollbar to a Text widget. Getting ready for addition of ttk scrollbars!
- `tooltip_offset` parm added to `set_options` as a way to set tooltip location (a hack to get around an 8.6.12 bug)
- `Table` and `Tree` elements new parameters
- `border_width` - the border width for the element
- `header_border_width` - the width of the border for the header
- `header_relief` - the type of header relief to use
- `Table` and `Tree` elements are now excluded from grab-anywhere so that headers can be resized without moving the window
## Code Condition
Make it run

View File

@ -146,7 +146,7 @@ Since the above packages each have a similar license clause, I'm listing them he
You all have my respect and admiration. You're enabling bigger things. What a special kind of thing to make. Who knows what you've enabled. I believe more people are getting over to your creations and getting to experience them.
tkinter team - PySimpleGUI would be nowhere without your lengthy work & continuous dedication. ONE GUI API for 3 different OS's? Really? With no code changes to move between? That's a huge accomplishment. You're #1 to me. Thank you for your hard work 🙏.
tkinter team - PySimpleGUI would be nowhere without your lengthy work & continuous dedication. ONE GUI API for 3 different OS's? Really? With no code changes to move between? That's a huge accomplishment. You're #1 to me. Thank you for your hard work.
## Getting Over "The Bar"

View File

@ -2423,6 +2423,54 @@ New Emojis for 2022... collect them all!
- Fix for Listbox scrollbar not behaving correctly when making element invisible / visible
- Docstring update for Window.perform_long_operation warns users that Thread are used and thus no PySimpleGUI calls are allowed. Also added description of exactly what happens when the user's function completes.
## 4.58.0 PySimpleGUI 3-Apr-2022
A little of this and that release
More focus on focus
`bind` methods improved with `propagate` parm
Visibility losing settings fix
- `execute_get_results` Added checking for timeout error to instead of showing an error popup as it's not truly an error in this case
- `Checkbox` Added cast to bool of default parm in case user passes in an incorrect type
- `ButtonMenu.update` addition of button_text parameter. Enables changing text displayed on the ButtonMenu. Should have been an original feature.
- Open GitHub Issue GUI Tabs use 2 lines now. Added tab asking where found PSG.
- New symbols `SYMBOL_CHECKMARK_SMALL` & `SYMBOL_X_SMALL`
- `ButtonMenu.Click` - Added click PEP8 alias `ButtonMenu.click`
- Automatically add timeouts to user reads if a debugger window is opened. Debugger for multi-window applications still needs to be added
- `Window.start_thread` a simple alias for `Window.perform_long_operation`. It's clearer what's happening with this alias.
- `bind_return_key` parm added to Spin element. If element has focus and the return key is pressed, then an event is generated.
- Event generation for disabled elements
- If an element is disabled, then don't generate events (fixed specifically for Input element). However, if a Browse button fills in a disabled element, then an event should still be generated
- Don't generate events if no files / folders selected using File or Folder Browse buttons. If cancel is clicked then no longer generates an event.
- Fix docstring for image in the Titlebar element. Incorrectly said an ICO file can be used. Must be PNG or GIF
- Windows-specific code that enables the PySimpleGUI supplied icon to be shown rather than the python.exe logo
- Removed all temporary Tk() window creation calls
- Instead create the hidden master root.
- These were required for operations like getting the list of fonts from tkinter, the screensize, character width and height. This way one and only one Tk window will ever be creeated
- The reason for the change is that the Mac crashes if multiple Tk() objects are created, even if only 1 at a time is active.
- `image_source` parm added to `Button`
- It can be either a filename or a base64 string.
- This is like the Image elements parms
- Graph element doc string improvement. Describes the mouse up event.
- Improved support for focus
- `Element.get_next_focus` added. Returns the element that should get the focus after the indicated element
- `Element.get_previous_focus` added. Returns the element that should get the focus after the indicated element
- Better exception error reporting for the Element focus methods. Uses popups with tracebacks now instead of prints
- `Window.widget_to_element` returns the element that a tkinter widget is used to implement (it's a reverse lookup)
- `Element.widget` added. It's a PEP8 compliant property that returns `Element.Widget`
- `Element.key` added. It's a PEP8 compliant property that returns `Element.Key`
- Simplified Radio, Checkbox, Slider creation. Moved the command parm outside the creation and instead made a config call.
- Visibility fix
- Expand and other settings were being lost when element is made invisible and visible again.
- `propagate` parameter to the bind methods. Used to tell tkinter whether or not to propagate the event to the element / or window
- `Canvas.update` method added so that a `Canvas` can be made visible/invisible
- Removed the need for `tk.scrolledtext.ScrolledText` by adding a vertical scrollbar to a Text widget. Getting ready for addition of ttk scrollbars!
- `tooltip_offset` parm added to `set_options` as a way to set tooltip location (a hack to get around an 8.6.12 bug)
- `Table` and `Tree` elements new parameters
- `border_width` - the border width for the element
- `header_border_width` - the width of the border for the header
- `header_relief` - the type of header relief to use
- `Table` and `Tree` elements are now excluded from grab-anywhere so that headers can be resized without moving the window
## Code Condition

View File

@ -157,7 +157,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -166,6 +168,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -620,7 +623,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -629,6 +634,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -1003,7 +1009,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -1012,6 +1020,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -1339,7 +1348,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -1348,6 +1359,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -1758,7 +1770,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -1767,6 +1781,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -2197,7 +2212,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -2206,6 +2223,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -2636,7 +2654,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -2645,6 +2665,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -3074,7 +3095,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -3083,6 +3106,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -4092,7 +4116,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -4101,6 +4127,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -4411,7 +4438,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -4420,6 +4449,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -4862,7 +4892,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -4871,6 +4903,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -5304,7 +5337,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -5313,6 +5348,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -5779,7 +5815,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -5788,6 +5826,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -6223,7 +6262,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -6232,6 +6273,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -6743,7 +6785,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -6752,6 +6796,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -7139,7 +7184,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -7148,6 +7195,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -7541,7 +7589,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -7550,6 +7600,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -7902,7 +7953,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -7911,6 +7964,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### expand
@ -8337,7 +8391,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -8346,6 +8402,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -8756,7 +8813,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -8765,6 +8824,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### expand
@ -9067,7 +9127,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -9076,6 +9138,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -9448,7 +9511,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -9457,6 +9522,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -9859,7 +9925,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -9868,6 +9936,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -10253,7 +10322,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -10262,6 +10333,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -10712,7 +10784,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -10721,6 +10795,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -11070,9 +11145,12 @@ Table(values,
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,
size = (None, None),
s = (None, None),
change_submits = False,
@ -11116,9 +11194,12 @@ Parameter Descriptions:
| str | header_text_color | sets the text color for the header |
| str | header_background_color | sets the background color for the header |
| (str or (str, int[, str]) or None) | header_font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
| (int or None) | header_border_width | Border width for the header portion |
| (str or None) | header_relief | Relief style for the header. Values are same as other elements that use relief. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
| List[Tuple[int, str] or Tuple[Int, str, str]] | row_colors | list of tuples of (row, background color) OR (row, foreground color, background color). Sets the colors of listed rows to the color(s) provided (note the optional foreground color) |
| bool | vertical_scroll_only | if True only the vertical scrollbar will be visible |
| bool | hide_vertical_scroll | if True vertical scrollbar will be hidden |
| int | border_width | Border width/depth in pixels |
| (int, int) | size | DO NOT USE! Use num_rows instead |
| bool | change_submits | DO NOT USE. Only listed for backwards compat - Use enable_events instead |
| bool | enable_events | Turns on the element specific events. Table events happen when row is clicked |
@ -11142,7 +11223,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -11151,6 +11234,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -11555,7 +11639,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -11564,6 +11650,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### expand
@ -11963,11 +12050,14 @@ Tree(data = None,
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,
row_height = None,
pad = None,
@ -12002,11 +12092,14 @@ Parameter Descriptions:
| (str or (str, int[, str]) or None) | font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
| str | justification | 'left', 'right', 'center' are valid choices |
| str | text_color | color of the text |
| int | border_width | Border width/depth in pixels |
| str | background_color | color of background |
| str or (str, str) | selected_row_colors | Sets the text color and background color for a selected row. Same format as button colors - tuple ('red', 'yellow') or string 'red on yellow'. Defaults to theme's button color |
| str | header_text_color | sets the text color for the header |
| str | header_background_color | sets the background color for the header |
| (str or (str, int[, str]) or None) | header_font | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
| (int or None) | header_border_width | Border width for the header portion |
| (str or None) | header_relief | Relief style for the header. Values are same as other elements that use relief. RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
| int | num_rows | The number of rows of the table to display at a time |
| int | row_height | height of a single row in pixels |
| (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) or int | 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) |
@ -12040,7 +12133,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -12049,6 +12144,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### block_focus
@ -12480,7 +12576,9 @@ Used to add tkinter events to an Element.
The tkinter specific data is in the Element's member variable user_bind_event
```
bind(bind_string, key_modifier)
bind(bind_string,
key_modifier,
propagate = True)
```
Parameter Descriptions:
@ -12489,6 +12587,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str | key_modifier | Additional data to be added to the element's key when event is returned |
| bool | propagate | If True then tkinter will be told to propagate the event to the element |
### expand
@ -12881,7 +12980,9 @@ Used to add tkinter events to a Window.
The tkinter specific data is in the Window's member variable user_bind_event
```
bind(bind_string, key)
bind(bind_string,
key,
propagate = True)
```
Parameter Descriptions:
@ -12890,6 +12991,7 @@ Parameter Descriptions:
|--|--|--|
| str | bind_string | The string tkinter expected in its bind function |
| str or int or tuple or object | key | The event that will be generated when the tkinter event occurs |
| bool | propagate | If True then tkinter will be told to propagate the event |
### bring_to_front
@ -19360,7 +19462,8 @@ set_options(icon = None,
keep_on_top = None,
dpi_awareness = None,
scaling = None,
disable_modal_windows = None)
disable_modal_windows = None,
tooltip_offset = (None, None))
```
Parameter Descriptions:
@ -19421,6 +19524,7 @@ Parameter Descriptions:
| bool | dpi_awareness | If True then will turn on DPI awareness (Windows only at the moment) |
| float | scaling | Sets the default scaling for all windows including popups, etc. |
| bool | disable_modal_windows | If True then all windows, including popups, will not be modal windows |
| ((None, None) or (int, int)) | tooltip_offset | Offset to use for tooltips as a tuple. These values will be added to the mouse location when the widget was entered. |
| None | **RETURN** | None
### Non PEP8 versions
@ -19492,7 +19596,8 @@ SetOptions(icon = None,
keep_on_top = None,
dpi_awareness = None,
scaling = None,
disable_modal_windows = None)
disable_modal_windows = None,
tooltip_offset = (None, None))
```
Parameter Descriptions:
@ -19553,6 +19658,7 @@ Parameter Descriptions:
| bool | dpi_awareness | If True then will turn on DPI awareness (Windows only at the moment) |
| float | scaling | Sets the default scaling for all windows including popups, etc. |
| bool | disable_modal_windows | If True then all windows, including popups, will not be modal windows |
| ((None, None) or (int, int)) | tooltip_offset | Offset to use for tooltips as a tuple. These values will be added to the mouse location when the widget was entered. |
| None | **RETURN** | None
## Old Themes (Look and Feel) - Replaced by theme()

View File

@ -9879,6 +9879,55 @@ New Emojis for 2022... collect them all!
- Fix for Listbox scrollbar not behaving correctly when making element invisible / visible
- Docstring update for Window.perform_long_operation warns users that Thread are used and thus no PySimpleGUI calls are allowed. Also added description of exactly what happens when the user's function completes.
## 4.58.0 PySimpleGUI 3-Apr-2022
A little of this and that release
More focus on focus
`bind` methods improved with `propagate` parm
Visibility losing settings fix
- `execute_get_results` Added checking for timeout error to instead of showing an error popup as it's not truly an error in this case
- `Checkbox` Added cast to bool of default parm in case user passes in an incorrect type
- `ButtonMenu.update` addition of button_text parameter. Enables changing text displayed on the ButtonMenu. Should have been an original feature.
- Open GitHub Issue GUI Tabs use 2 lines now. Added tab asking where found PSG.
- New symbols `SYMBOL_CHECKMARK_SMALL` & `SYMBOL_X_SMALL`
- `ButtonMenu.Click` - Added click PEP8 alias `ButtonMenu.click`
- Automatically add timeouts to user reads if a debugger window is opened. Debugger for multi-window applications still needs to be added
- `Window.start_thread` a simple alias for `Window.perform_long_operation`. It's clearer what's happening with this alias.
- `bind_return_key` parm added to Spin element. If element has focus and the return key is pressed, then an event is generated.
- Event generation for disabled elements
- If an element is disabled, then don't generate events (fixed specifically for Input element). However, if a Browse button fills in a disabled element, then an event should still be generated
- Don't generate events if no files / folders selected using File or Folder Browse buttons. If cancel is clicked then no longer generates an event.
- Fix docstring for image in the Titlebar element. Incorrectly said an ICO file can be used. Must be PNG or GIF
- Windows-specific code that enables the PySimpleGUI supplied icon to be shown rather than the python.exe logo
- Removed all temporary Tk() window creation calls
- Instead create the hidden master root.
- These were required for operations like getting the list of fonts from tkinter, the screensize, character width and height. This way one and only one Tk window will ever be creeated
- The reason for the change is that the Mac crashes if multiple Tk() objects are created, even if only 1 at a time is active.
- `image_source` parm added to `Button`
- It can be either a filename or a base64 string.
- This is like the Image elements parms
- Graph element doc string improvement. Describes the mouse up event.
- Improved support for focus
- `Element.get_next_focus` added. Returns the element that should get the focus after the indicated element
- `Element.get_previous_focus` added. Returns the element that should get the focus after the indicated element
- Better exception error reporting for the Element focus methods. Uses popups with tracebacks now instead of prints
- `Window.widget_to_element` returns the element that a tkinter widget is used to implement (it's a reverse lookup)
- `Element.widget` added. It's a PEP8 compliant property that returns `Element.Widget`
- `Element.key` added. It's a PEP8 compliant property that returns `Element.Key`
- Simplified Radio, Checkbox, Slider creation. Moved the command parm outside the creation and instead made a config call.
- Visibility fix
- Expand and other settings were being lost when element is made invisible and visible again.
- `propagate` parameter to the bind methods. Used to tell tkinter whether or not to propagate the event to the element / or window
- `Canvas.update` method added so that a `Canvas` can be made visible/invisible
- Removed the need for `tk.scrolledtext.ScrolledText` by adding a vertical scrollbar to a Text widget. Getting ready for addition of ttk scrollbars!
- `tooltip_offset` parm added to `set_options` as a way to set tooltip location (a hack to get around an 8.6.12 bug)
- `Table` and `Tree` elements new parameters
- `border_width` - the border width for the element
- `header_border_width` - the width of the border for the header
- `header_relief` - the type of header relief to use
- `Table` and `Tree` elements are now excluded from grab-anywhere so that headers can be resized without moving the window
## Code Condition
Make it run