From 6398bfd432cd2d97716ed61e588ac5ac17089143 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Wed, 16 Jan 2019 23:50:53 -0500 Subject: [PATCH 1/5] 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 b3f0e8eb..c0d7f50c 100644 --- a/readme.md +++ b/readme.md @@ -4856,7 +4856,7 @@ Emergency patch release... going out same day as previous release * 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 +* Invisibility for ButtonMenusup * Attempt at specifying size of Column elements (limited success) * Table Element * New row_colors parameter @@ -4985,5 +4985,5 @@ 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 \ No newline at end of file From be79bb4e0f75751a8e61e783310f22c8ad47cf15 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Wed, 16 Jan 2019 23:53:02 -0500 Subject: [PATCH 2/5] 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 c0d7f50c..c480535d 100644 --- a/readme.md +++ b/readme.md @@ -750,6 +750,9 @@ This is a typpical call ![popupgetfolder](https://user-images.githubusercontent.com/13696193/44957861-45484080-aea5-11e8-926c-cf607a45251c.jpg) +### PopupAnimated + + @@ -4985,5 +4988,5 @@ 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 \ No newline at end of file From df471cd354fa968d928b2cb0baab27a9f317b34e Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Thu, 17 Jan 2019 00:02:52 -0500 Subject: [PATCH 3/5] margins parameter for Windows --- PySimpleGUI.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 7f42ee03..bdf8d0c6 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -3422,7 +3422,7 @@ class Window: def __init__(self, title, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size=(None, None), - auto_size_text=None, auto_size_buttons=None, location=(None, None), size=(None, None), element_padding=None, button_color=None, font=None, + auto_size_text=None, auto_size_buttons=None, location=(None, None), size=(None, None), element_padding=None, margins=(None, None), button_color=None, font=None, progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False, auto_close_duration=DEFAULT_AUTOCLOSE_TIME, icon=DEFAULT_WINDOW_ICON, force_toplevel=False, alpha_channel=1, return_keyboard_events=False, use_default_focus=True, text_justification=None, @@ -3511,6 +3511,7 @@ class Window: self.XFound = False self.ElementPadding = element_padding or DEFAULT_ELEMENT_PADDING self.RightClickMenu = right_click_menu + self.Margins = margins if margins != (None, None) else DEFAULT_MARGINS @classmethod def IncrementOpenCount(self): @@ -5876,10 +5877,10 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form:Window): # ............................DONE WITH ROW pack the row of widgets ..........................# # done with row, pack the row of widgets # tk_row_frame.grid(row=row_num+2, sticky=tk.NW, padx=DEFAULT_MARGINS[0]) - tk_row_frame.pack(side=tk.TOP, anchor='nw', padx=DEFAULT_MARGINS[0], expand=False) + tk_row_frame.pack(side=tk.TOP, anchor='nw', padx=toplevel_form.Margins[0], expand=False) if form.BackgroundColor is not None and form.BackgroundColor != COLOR_SYSTEM_DEFAULT: tk_row_frame.configure(background=form.BackgroundColor) - toplevel_form.TKroot.configure(padx=DEFAULT_MARGINS[0], pady=DEFAULT_MARGINS[1]) + toplevel_form.TKroot.configure(padx=toplevel_form.Margins[0], pady=toplevel_form.Margins[1]) return @@ -7424,7 +7425,6 @@ def PopupGetText(message, title=None, default_text='', password_char='', size=(N # --------------------------- PopupAnimated --------------------------- - def PopupAnimated(image_source, message=None, background_color=None, text_color=None, font=None, no_titlebar=True, grab_anywhere=True, keep_on_top=True, location=(None, None), alpha_channel=.8, time_between_frames=0): if image_source is None: @@ -7440,13 +7440,13 @@ def PopupAnimated(image_source, message=None, background_color=None, text_color= layout.append([Text(message, background_color=background_color, text_color=text_color, font=font)]) window = Window('Animated GIF', no_titlebar=no_titlebar, grab_anywhere=grab_anywhere, keep_on_top=keep_on_top, - background_color=background_color, location=location, alpha_channel=alpha_channel).Layout(layout).Finalize() + background_color=background_color, location=location, alpha_channel=alpha_channel, element_padding=(0,0), margins=(0,0)).Layout(layout).Finalize() Window.animated_popup_dict[image_source] = window else: window = Window.animated_popup_dict[image_source] window.Element('_IMAGE_').UpdateAnimation(image_source, time_between_frames=time_between_frames) - window.Refresh() - # button, values = window.Read(timeout=0) + + window.Refresh() # call refresh instead of Read to save significant CPU time From e0c3aa3fb83ac844fbb26baff92b595c35d67d9c Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Thu, 17 Jan 2019 00:11:23 -0500 Subject: [PATCH 4/5] readme.md updated from https://stackedit.io/ --- readme.md | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/readme.md b/readme.md index c480535d..bcc37205 100644 --- a/readme.md +++ b/readme.md @@ -751,11 +751,31 @@ This is a typpical call ### PopupAnimated + + ![ring](https://user-images.githubusercontent.com/13696193/51296743-6ee4ad00-19eb-11e9-91f5-cd8086ad1b50.gif) +The animated Popup enables you to easily display a "loading" style animation specified through a GIF file that is either stored in a file or a base64 variable. + +```python +def PopupAnimated(image_source, + message=None, + background_color=None, + text_color=None, + font=None, + no_titlebar=True, + grab_anywhere=True, + keep_on_top=True, + location=(None, None), + alpha_channel=.8, + time_between_frames=0) +``` +image_source - The GIF file specified as a string filename or a base64 variable +message - optional text message to be displayed under the animation +background_color - the backgrouned color to use for the window and all of the other parts of the window +font - font to use for the optional text - - + # Progress Meters! We all have loops in our code. 'Isn't it joyful waiting, watching a counter scrolling past in a text window? How about one line of code to get a progress meter, that contains statistics about your code? @@ -4973,20 +4993,7 @@ Here are the steps to run that application Install howdoi: pip install howdoi Test your install: - python -m howdoi howdoi.py - To run it: - Python HowDoI.py - -The pip command is all there is to the setup. - -The way HowDoI works is that it uses your search term to look through stack overflow posts. It finds the best answer, gets the code from the answer, and presents it as a response. It gives you the correct answer OFTEN. It's a miracle that it work SO well. -For Python questions, I simply start my query with 'Python'. Let's say you forgot how to reverse a list in Python. When you run HowDoI and ask this question, this is what you'll see. - -![howdoiwithhistory](https://user-images.githubusercontent.com/13696193/45064009-5fd61180-b07f-11e8-8ead-eb0d1ff3a6be.jpg) - - - -In the hands of a competent programmer, this tool is **amazing**. It's a must-try kind of program that has completely changed my + python -m \ No newline at end of file From a088e4a6c65438a1bd870b8baef660999f7a6fa0 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy <13696193+MikeTheWatchGuy@users.noreply.github.com> Date: Thu, 17 Jan 2019 00:18:45 -0500 Subject: [PATCH 5/5] readme.md updated from https://stackedit.io/ --- readme.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index bcc37205..4cec553f 100644 --- a/readme.md +++ b/readme.md @@ -771,9 +771,15 @@ def PopupAnimated(image_source, ``` image_source - The GIF file specified as a string filename or a base64 variable message - optional text message to be displayed under the animation -background_color - the backgrouned color to use for the window and all of the other parts of the window +background_color - the background color to use for the window and all of the other parts of the window +text_color - color to use for optional text font - font to use for the optional text +no_titlebar - no titlebar window setting +location - location to show the window +alpha_channel - alpha channel to use for the window +time_between_frames - amount of time in milliseconds to use between frames +***To close animated popups***, call PopupAnimated with `image_source=None`. This will close all of the currently open PopupAnimated windows. # Progress Meters! @@ -4986,14 +4992,6 @@ GNU Lesser General Public License (LGPL 3) + ## How Do I Finally, I must thank the fine folks at How Do I. -https://github.com/gleitz/howdoi -Their utility has forever changed the way and pace in which I can program. I urge you to try the HowDoI.py application here on GitHub. Trust me, **it's going to be worth the effort!** -Here are the steps to run that application - - Install howdoi: - pip install howdoi - Test your install: - python -m \ No newline at end of file