From f1a2c7c3c2f65ac428ad9fd0bc7d9a412d926ca2 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sat, 29 Sep 2018 22:58:38 -0400 Subject: [PATCH] Fix for returning tab KEY when returning results for tab group --- PySimpleGUI.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PySimpleGUI.py b/PySimpleGUI.py index bf75e4ac..7108579a 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1576,6 +1576,12 @@ class TabGroup(Element): element = row[col_num] return element + def FindKeyFromTabName(self, tab_name): + for row in self.Rows: + for element in row: + if element.Title == tab_name: + return element.Key + return None def __del__(self): for row in self.Rows: @@ -2663,6 +2669,9 @@ def BuildResultsForSubform(form, initialize_only, top_level_form): elif element.Type == ELEM_TYPE_TAB_GROUP: try: value=element.TKNotebook.tab(element.TKNotebook.index('current'))['text'] + tab_key = element.FindKeyFromTabName(value) + if tab_key is not None: + value = tab_key except: value = None else: