New TabGroup Method - SelectTab

This commit is contained in:
MikeTheWatchGuy 2019-06-13 15:06:15 -04:00
parent 832443efd8
commit 4d4b7b7b3b
1 changed files with 9 additions and 2 deletions

View File

@ -2577,7 +2577,8 @@ class TabGroup(Element):
self.ParentWindow = None
self.SelectedTitleColor = selected_title_color
self.Rows = []
self.TKNotebook = None
self.TKNotebook = None # type: ttk.Notebook
self.Widget = None # type: ttk.Notebook
self.TabCount = 0
self.BorderWidth = border_width
self.Theme = theme
@ -2623,6 +2624,12 @@ class TabGroup(Element):
return element.Key
return None
def SelectTab(self, index):
try:
self.TKNotebook.select(index)
except Exception as e:
print('Exception Selecting Tab {}'.format(e))
def __del__(self):
for row in self.Rows:
for element in row:
@ -5950,7 +5957,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
element.TKFrame.bind('<Button-3>', element._RightClickMenuCallback)
# ------------------------- TabGroup element ------------------------- #
elif element_type == ELEM_TYPE_TAB_GROUP:
element=element # type: TabGroup
custom_style = str(element.Key) + 'customtab.TNotebook'
style = ttk.Style(tk_row_frame)
if element.Theme is not None: