From 269ffbe91fd6007c9d675ce10622647912d3957c Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Thu, 14 May 2020 22:45:08 -0400 Subject: [PATCH 1/2] Fixed menu tearoff not working (weird no one reported... dunno what happened) --- PySimpleGUI.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 3f5f5d4a..d8829784 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1,6 +1,6 @@ #!/usr/bin/python3 -version = __version__ = "4.19.0.2 Unreleased - Window.set_title added, removed resetting stdout when flush happens" +version = __version__ = "4.19.0.3 Unreleased - Window.set_title added, removed resetting stdout when flush happens, fixed MenuBar tearoff not working" port = 'PySimpleGUI' @@ -641,7 +641,7 @@ class Element(): self.Visible = visible self.TKRightClickMenu = None self.Widget = None # Set when creating window. Has the main tkinter widget for element - self.Tearoff = False + # self.Tearoff = False # why was this here?? should already be in the Menubar element...confusing... self.ParentRowFrame = None # type tk.Frame self.metadata = metadata # type: Any self.user_bind_dict = {} # Used when user defines a tkinter binding using bind method - convert bind string to key modifier @@ -10684,6 +10684,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form): # ------------------------- MENU placement element ------------------------- # elif element_type == ELEM_TYPE_MENUBAR: element = element # type: MenuBar + print(f'Menu tearoff = {element.Tearoff}') menu_def = element.MenuDefinition element.TKMenu = element.Widget = tk.Menu(toplevel_form.TKroot, tearoff=element.Tearoff) # create the menubar From 8d5b59af6694b5c2e87db4e479bba5fba0381830 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Thu, 14 May 2020 22:45:21 -0400 Subject: [PATCH 2/2] Simplified --- DemoPrograms/Demo_OpenCV.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/DemoPrograms/Demo_OpenCV.py b/DemoPrograms/Demo_OpenCV.py index 00d2a1af..ea5cf72d 100644 --- a/DemoPrograms/Demo_OpenCV.py +++ b/DemoPrograms/Demo_OpenCV.py @@ -34,10 +34,7 @@ def main(): [sg.Button('Exit', size=(7, 1), pad=((600, 0), 3), font='Helvetica 14')]] # create the window and show it without the plot - window = sg.Window('Demo Application - OpenCV Integration', - layout, - no_titlebar=False, - location=(0, 0)) + window = sg.Window('Demo Application - OpenCV Integration', layout, no_titlebar=False, location=(0, 0)) # locate the elements we'll be updating. Does the search only 1 time image_elem = window['-image-']