From 879b3244b1ad61bc53b9423705e590c48e264e03 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:21:29 -0500 Subject: [PATCH 01/14] readme.md updated from https://stackedit.io/ --- readme.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 803f6913..bc66dd0c 100644 --- a/readme.md +++ b/readme.md @@ -4806,6 +4806,24 @@ Emergency patch release... going out same day as previous release * Attempted to use Styles better with Combobox * Fixed bug blocking setting bar colors in OneLineProgressMeter +# 3.22.0 PySimpleGUI + +* Added type hints to some portions of the code +* Output element can be made invisible +* Image sizing and subsample for Button images +* Invisibility for ButtonMenus +* Attempt at specifying size of Column elements (limited success) +* Table Element + * New row_colors paramter + * New vertical_scroll_only parameter +* Tree Element + * New row_height paramter + * New feature - Icons for tree entries using filename or Base64 images +* Fix for bug sending back continuous mouse events +* New paramter silence_on_error for FindElement / Element calls +* Slider returns float now +* Fix for Menus when using Python 2.7 +* Combobox Styling (again) ### Upcoming @@ -4913,4 +4931,7 @@ For Python questions, I simply start my query with 'Python'. Let's say you forg In the hands of a competent programmer, this tool is **amazing**. It's a must-try kind of program that has completely changed my programming process. I'm not afraid of asking for help! You just have to be smart about using what you find. -The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file +The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. + \ No newline at end of file From 0c108df99c214e838d22109bbe5b6d9932792f47 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:23:08 -0500 Subject: [PATCH 02/14] readme.md updated from https://stackedit.io/ --- readme.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index bc66dd0c..b6d48624 100644 --- a/readme.md +++ b/readme.md @@ -31,9 +31,9 @@ -![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.21.0-red.svg?longCache=true&style=for-the-badge) +![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.22.0-red.svg?longCache=true&style=for-the-badge) -![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.21.0-blue.svg?longCache=true&style=for-the-badge) +![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.22.0-blue.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUIQt_For_Python_3.x_Version-0.22.0-orange.svg?longCache=true&style=for-the-badge) @@ -3147,7 +3147,8 @@ The Tree Element and Table Element are close cousins. Many of the parameters f Tree( data=None, headings=None, visible_column_map=None, - col_widths=None, col0_width=10, + col_widths=None, + col0_width=10, def_col_width=10, auto_size_columns=True, max_col_width=20, @@ -3160,6 +3161,7 @@ Tree( data=None, text_color=None, background_color=None, num_rows=None, + row_height=None, pad=None, key=None, tooltip=None, @@ -4933,5 +4935,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 7407413177e25aa72ca82de444406f81b404f165 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:24:45 -0500 Subject: [PATCH 03/14] readme.md updated from https://stackedit.io/ --- readme.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index b6d48624..b462cd22 100644 --- a/readme.md +++ b/readme.md @@ -3091,6 +3091,7 @@ Table( values, text_color=None, background_color=None, alternating_row_color=None, + row_colors=None, size=(None,None), change_submits=False, enable_events=False, @@ -3183,7 +3184,8 @@ class Tree(data=None - data in TreeData format justification='right' - justification for data display text_color=None- color of text to display background_color=None - background color - num_rows=None - number of rows to display + num_rows=None - number of rows to display + row_height=None - height of rows in pixels pad=None - element padding key=None - key for element tooltip=None - tooltip @@ -4935,5 +4937,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 70ff86b179b2aa69c8ded9aefeb6d0205e24a112 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:26:22 -0500 Subject: [PATCH 04/14] readme.md updated from https://stackedit.io/ --- readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b462cd22..5d673b7d 100644 --- a/readme.md +++ b/readme.md @@ -3092,6 +3092,7 @@ Table( values, background_color=None, alternating_row_color=None, row_colors=None, + vertical_scroll_only=True, size=(None,None), change_submits=False, enable_events=False, @@ -3099,6 +3100,7 @@ Table( values, pad=None, key=None, tooltip=None, + right_click_menu=None, visible=True): ``` @@ -3118,6 +3120,7 @@ font - font for table entries justification - left, right, center text_color - color of text alternating row color - if set will change background color for alternating rows +row_colors - list of tuples representing (row_number, color) background_color - cell background color size - (None, number of rows) - don't use, use num_rows instead enable_events - will return a 'row selected' event when row is selected @@ -4937,5 +4940,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 3547d139b0422f6e407326084d7a369f2c1d2c4b Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:28:01 -0500 Subject: [PATCH 05/14] readme.md updated from https://stackedit.io/ --- readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 5d673b7d..acf00d90 100644 --- a/readme.md +++ b/readme.md @@ -3120,7 +3120,8 @@ font - font for table entries justification - left, right, center text_color - color of text alternating row color - if set will change background color for alternating rows -row_colors - list of tuples representing (row_number, color) +row_colors - list of tuples representing (row_number, color) e.g. row_colors = ((5, 'white', 'blue'), (0,'red'), (15,'yellow')) +vertical_scroll_only - if True will not show a horizontal scrollbar background_color - cell background color size - (None, number of rows) - don't use, use num_rows instead enable_events - will return a 'row selected' event when row is selected @@ -4940,5 +4941,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 211f0bb77d3b406247802bf2a61b107ecd917bb6 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:29:39 -0500 Subject: [PATCH 06/14] readme.md updated from https://stackedit.io/ --- readme.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index acf00d90..f02db25b 100644 --- a/readme.md +++ b/readme.md @@ -3121,7 +3121,7 @@ justification - left, right, center text_color - color of text alternating row color - if set will change background color for alternating rows row_colors - list of tuples representing (row_number, color) e.g. row_colors = ((5, 'white', 'blue'), (0,'red'), (15,'yellow')) -vertical_scroll_only - if True will not show a horizontal scrollbar +vertical_scroll_only - if True will not show a horizontal scrollbar. NOTE - will have to disable to get horizontal scrollbars background_color - cell background color size - (None, number of rows) - don't use, use num_rows instead enable_events - will return a 'row selected' event when row is selected @@ -4781,7 +4781,7 @@ Emergency patch release... going out same day as previous release ## 3.20.0 & 1.20.0 18-Dec-2018 * New Pane Element -* Graphh.DeleteFigure method +* Graph.DeleteFigure method * disable_minimize - New parameter for Window * Fix for 2.7 menus * Debug Window no longer re-routes stdout by default @@ -4814,7 +4814,7 @@ Emergency patch release... going out same day as previous release * Attempted to use Styles better with Combobox * Fixed bug blocking setting bar colors in OneLineProgressMeter -# 3.22.0 PySimpleGUI +# 3.22.0 PySimpleGUI / 1.22.0 PySimpleGUI27 * Added type hints to some portions of the code * Output element can be made invisible @@ -4822,13 +4822,13 @@ Emergency patch release... going out same day as previous release * Invisibility for ButtonMenus * Attempt at specifying size of Column elements (limited success) * Table Element - * New row_colors paramter - * New vertical_scroll_only parameter + * New row_colors parameter + * New vertical_scroll_only parameter - NOTE - will have to disable to get horizontal scrollbars * Tree Element - * New row_height paramter + * New row_height parameter * New feature - Icons for tree entries using filename or Base64 images * Fix for bug sending back continuous mouse events -* New paramter silence_on_error for FindElement / Element calls +* New parameter silence_on_error for FindElement / Element calls * Slider returns float now * Fix for Menus when using Python 2.7 * Combobox Styling (again) @@ -4941,5 +4941,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 2395d9572d2840b9caeb114d07e4319a41761854 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:31:14 -0500 Subject: [PATCH 07/14] readme.md updated from https://stackedit.io/ --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index f02db25b..cab8448e 100644 --- a/readme.md +++ b/readme.md @@ -4431,7 +4431,7 @@ Listboxes are still without scrollwheels. The mouse can drag to see more items. 3.0 We've come a long way baby! Time for a major revision bump. One reason is that the numbers started to confuse people the latest release was 2.30, but some people read it as 2.3 and thought it went backwards. I kinda messed up the 2.x series of numbers, so why not start with a clean slate. A lot has happened anyway so it's well earned. -One change that will set PySimpleGUI apart is the parlor trick of being able to move the window by clicking on it anywhere. This is turned on by default. It's not a common way to interact with windows. Normally you have to move using the titlebar. Not so with PySimpleGUI. Now you can drag using any part of the window. You will want to turn this off for windows with sliders. This feature is enabled in the Window call. +One change that will set PySimpleGUI apart is the parlor trick of being able to move the window by clicking on it anywhere. This is turned on by default. It's not a common way to interact with windows. Normally you have to move using the titlebar. Not so with PySimpleGUI. Now you can drag using any part of the window. You will want to turn off for windows with sliders. This feature is enabled in the Window call. Related to the Grab Anywhere feature is the no_titlebar option, again found in the call to Window. Your window will be a spiffy, borderless window. It's a really interesting effect. Slight problem is that you do not have an icon on the taskbar with these types of windows, so if you don't supply a button to close the window, there's no way to close it other than task manager. @@ -4941,5 +4941,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 79609105759f85c964c0d4d6c609628b2a416d4e Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:32:50 -0500 Subject: [PATCH 08/14] readme.md updated from https://stackedit.io/ --- readme.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index cab8448e..59396dce 100644 --- a/readme.md +++ b/readme.md @@ -3199,7 +3199,13 @@ Unlike Tables there is no standard format for trees. Thus the data structure pa * Get a TreeData Object * "Insert" data into the tree * Pass the filled in TreeData object to Tree Element - + +#### TreeData format +```python +def TreeData() +def Insert(self, parent, key, text, values, icon=None) +``` + To "insert" data into the tree the TreeData method Insert is called. `Insert(parent_key, key, display_text, values)` @@ -4941,5 +4947,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From e3c566f9a7cec788bdd9aadd6aa48f9451c55073 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:34:30 -0500 Subject: [PATCH 09/14] readme.md updated from https://stackedit.io/ --- readme.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 59396dce..1cbe014c 100644 --- a/readme.md +++ b/readme.md @@ -3225,6 +3225,12 @@ Note that you ***can*** use the same values for display_text and keys. The only When Reading a window the Table Element will return a list of rows that are selected by the user. The list will be empty is no rows are selected. +#### Icons on Tree Entries + +If you wish to show an icon next to a tree item, then you specify the icon in the call to `Insert`. You pass in a filename or a Base64 bytes string. + + + ## Tab and Tab Group Elements @@ -4947,5 +4953,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 488d1dc797f58adf7c879edb64532fcf25a0f53f Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:36:16 -0500 Subject: [PATCH 10/14] readme.md updated from https://stackedit.io/ --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 1cbe014c..6de1aca3 100644 --- a/readme.md +++ b/readme.md @@ -3227,7 +3227,7 @@ When Reading a window the Table Element will return a list of rows that are sele #### Icons on Tree Entries -If you wish to show an icon next to a tree item, then you specify the icon in the call to `Insert`. You pass in a filename or a Base64 bytes string. +If you wish to show an icon next to a tree item, then you specify the icon in the call to `Insert`. You pass in a filename or a Base64 bytes string using the optional `icon` parameter. @@ -4953,5 +4953,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From bd4cc84c899f51a53cbaced23161c7622ee0f0b7 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:37:57 -0500 Subject: [PATCH 11/14] readme.md updated from https://stackedit.io/ --- readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 6de1aca3..97652be0 100644 --- a/readme.md +++ b/readme.md @@ -3229,7 +3229,9 @@ When Reading a window the Table Element will return a list of rows that are sele If you wish to show an icon next to a tree item, then you specify the icon in the call to `Insert`. You pass in a filename or a Base64 bytes string using the optional `icon` parameter. +Here is the result of +![image](https://user-images.githubusercontent.com/13696193/51087270-2b561e80-171f-11e9-8260-6142ea9b1137.png) ## Tab and Tab Group Elements @@ -4953,5 +4955,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From ac7dbac26cac1cb64a2678217d3d5f62b2b5a56a Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:38:23 -0500 Subject: [PATCH 12/14] readme.md updated from https://stackedit.io/ --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 97652be0..47cc46aa 100644 --- a/readme.md +++ b/readme.md @@ -3229,7 +3229,7 @@ When Reading a window the Table Element will return a list of rows that are sele If you wish to show an icon next to a tree item, then you specify the icon in the call to `Insert`. You pass in a filename or a Base64 bytes string using the optional `icon` parameter. -Here is the result of +Here is the result of showing an icon with a tree entry. ![image](https://user-images.githubusercontent.com/13696193/51087270-2b561e80-171f-11e9-8260-6142ea9b1137.png) @@ -4955,5 +4955,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 009a9f385311456cd80f5fb7cb6534edf3528d15 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:40:02 -0500 Subject: [PATCH 13/14] readme.md updated from https://stackedit.io/ --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 47cc46aa..bf1328a7 100644 --- a/readme.md +++ b/readme.md @@ -1507,7 +1507,7 @@ There are a few methods (functions) that you will see in this document that act window.Close() - To close your window, if a button hasn't already closed it window.Disable() - Use to disable the window inputwhen opening another window on top of the primnary Window window.Enable() - Re-enable a Disabled window - window.FindElement(key) - Returns the element that has a matching key value + window.FindElement(key, silent_on_error=None) - Returns the element that has a matching key value window.Move(x,y) - Moves window to location x,y on screen' window.SetAlpha(alpha) - Changes window transparency window.BringToFront() - Brings the window to the top of other windows on the screen @@ -4955,5 +4955,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file From 8f56a7e64588c4d47b99ef6566b3c9c34c939672 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Sun, 13 Jan 2019 10:41:43 -0500 Subject: [PATCH 14/14] readme.md updated from https://stackedit.io/ --- readme.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index bf1328a7..8846c8c1 100644 --- a/readme.md +++ b/readme.md @@ -1507,7 +1507,7 @@ There are a few methods (functions) that you will see in this document that act window.Close() - To close your window, if a button hasn't already closed it window.Disable() - Use to disable the window inputwhen opening another window on top of the primnary Window window.Enable() - Re-enable a Disabled window - window.FindElement(key, silent_on_error=None) - Returns the element that has a matching key value + window.FindElement(key, silent_on_error=False) - Returns the element that has a matching key value window.Move(x,y) - Moves window to location x,y on screen' window.SetAlpha(alpha) - Changes window transparency window.BringToFront() - Brings the window to the top of other windows on the screen @@ -1532,6 +1532,9 @@ window = sg.Window('My window title').Layout(layout) #### Finalize() Call to force a window to go through the final stages of initialization. This will cause the tkinter resources to be allocated so that they can then be modified. This also causes your window to appear. If you do not want your window to appear when Finalize is called, then set the Alpha to 0 in your window's creation parameters. + +If you want to call an element's Update method or call a Graph element's drawing primitives, you ***must*** either call Read or Finalize prior to making those calls. + #### Read(timeout=None, timeout_key='__TIMEOUT_ _ ') @@ -4955,5 +4958,5 @@ In the hands of a competent programmer, this tool is **amazing**. It's a must- The PySimpleGUI window that the results are shown in is an 'input' field which means you can copy and paste the results right into your code. \ No newline at end of file