From e68234bb15cf714265646c4db15e40c37e1e509c Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sun, 31 Mar 2019 12:28:04 -0400 Subject: [PATCH] Release 3.27 --- PySimpleGUI.py | 1 - PySimpleGUI27.py | 9 ++++++++- readme.md | 10 +++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 61306f7c..59b06ce7 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -40,7 +40,6 @@ g_time_end = 0 g_time_delta = 0 - def TimerStart(): global g_time_start diff --git a/PySimpleGUI27.py b/PySimpleGUI27.py index 102a9efe..e73f5d83 100644 --- a/PySimpleGUI27.py +++ b/PySimpleGUI27.py @@ -731,7 +731,7 @@ class OptionMenu(Element): ''' self.Values = values self.DefaultValue = default_value - self.TKOptionMenu = None + self.TKOptionMenu = None # type: tk.OptionMenu self.Disabled = disabled bg = background_color if background_color else DEFAULT_INPUT_ELEMENTS_COLOR fg = text_color if text_color is not None else DEFAULT_INPUT_TEXT_COLOR @@ -742,6 +742,13 @@ class OptionMenu(Element): def Update(self, value=None, values=None, disabled=None, visible=None): if values is not None: self.Values = values + self.TKOptionMenu['menu'].delete(0, 'end') + + # Insert list of new options (tk._setit hooks them up to var) + self.TKStringVar.set(self.Values[0]) + for new_value in self.Values: + self.TKOptionMenu['menu'].add_command(label=new_value, command=tk._setit(self.TKStringVar, new_value)) + if self.Values is not None: for index, v in enumerate(self.Values): if v == value: diff --git a/readme.md b/readme.md index dadfbe45..c9505f2d 100644 --- a/readme.md +++ b/readme.md @@ -33,9 +33,9 @@ -![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.26.0-red.svg?longCache=true&style=for-the-badge) +![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_3.x_Version-3.27.0-red.svg?longCache=true&style=for-the-badge) -![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.26.0-blue.svg?longCache=true&style=for-the-badge) +![Python Version](https://img.shields.io/badge/PySimpleGUI_For_Python_2.7_Version-1.27.0-blue.svg?longCache=true&style=for-the-badge) ![Python Version](https://img.shields.io/badge/PySimpleGUIQt_Version-0.23.0-orange.svg?longCache=true&style=for-the-badge) @@ -4903,7 +4903,9 @@ Emergency patch release... going out same day as previous release * OneLineProgressMeter - Can now change the text on every call if desired -# 3.26.0 PySimpleGUI 23-Mar-2019 +## 3.27.0 PySimpleGUI 31-Mar-2019 + +Mixup.... 3.26 changes don't appear to have been correctly released so releasing in 3.27 now * do_not_clear now defaults to TRUE!!! * Input Element @@ -4912,6 +4914,8 @@ Emergency patch release... going out same day as previous release * Ability to modify Autoscroll setting in Multiline.Update call * PopupGetFolder, PopupGetFile, PopupGetText - title defaults to message if none provided * PopupAnimated - image_source can be a filename or bytes (base64) +* Option Menu can now have values updated + ### Upcoming