Closed VP1701 closed 2 months ago
Hello @VP1701 ,
here is an example for you:
import remi.gui as gui
from remi import start, App
class MyApp(App):
def __init__(self, *args):
super(MyApp, self).__init__(*args)
def main(self):
tb = gui.TabBox(width='80%')
tb.append(gui.Label("tab 1"), 'First')
tb.add_tab(gui.Label("tab 2"), 'Second', None)
tb.add_tab(gui.Label("tab 3"), 'Third', None)
tb.on_tab_selection.do(self.on_tab_selection)
return tb
def on_tab_selection(self, widget, tab_key):
print("tab selected:", tab_key)
if __name__ == "__main__":
start(MyApp, title="Tab Demo")
have a nice day
Thank you. this helped a lot.
Is there a way for having some kind of a onclick or onchange method to trigger methods when changing tabs? I'm showing data on different tabs and I would like to stop the update methods for different tabs when I'm not looking at them.