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