I want to switch to another tab from code when some action is completed in jupyter lab, the documentation is rather sparse! Surely there is some method on a tab / accordian etc, where I can make it switch rather than making the user click on the tab?
import ipywidgets as widgets
def goto_tab2(btn):
tab2.children[0].value='Been there'
tabset.switch_tab(1) # what is the method to call here?
def goto_tab1(btn):
# tabset.switch_tab(0)
pass
tab1 = widgets.VBox([widgets.Text(), widgets.Button(description='set name')])
tab1.children[1].on_click(goto_tab2)
tab2 = widgets.VBox([widgets.Text(), widgets.Button(description='GO BACK!', on_click=goto_tab1)])
tab2.children[1].on_click(goto_tab1)
tabset=widgets.Tab([tab1, tab2])
tabset.set_title(0, 'Tab1')
tabset.set_title(1, 'Tab2')
tabset