CustomTkinter
CustomTkinter copied to clipboard
CtkTabView Tab Changed Event not implemented
Is there any way to bind to the Tab Changed event? I've tried <<NotebookTabChanged>> but the 'Not Implemented' error keeps being reported.
<<Visibility>> works for setup but there is no way to easily tear down tabs when they are changed.
I checked the code for it it's just straight up not implemented idk I'm looking for a solution also cause I need the event and I don't want to have to change the code cause I'm making something public
@Turnrp I got around this by using the after() method in the tkinter app. Just call check_tab_change() once in your app initialization
# Create main tabs for the different tests
self.tabview = ctk.CTkTabview(self)
self.tabdict = {}
tabname = "Burn-in Test"
self.tabview.add(tabname)
self.burn_in_tab = BurnInTab(self, self.tabview.tab(tabname), tabname)
self.tabdict[tabname] = self.burn_in_tab
self.tabview.set(tabname)
# Check if the current tab has changed
# If so, restart the tests
# This event is polled every 100 ms
def check_tab_change(self):
global last_tab
current_tab = self.tabview.get()
if 'last_tab' in globals():
if current_tab != last_tab:
for tab in self.tabdict.values():
tab.reset_test()
last_tab = current_tab
self.after(100, self.check_tab_change)
@JJenkinsDaxsonics oh cool thank you!
Any updates or plans on implementing this?