Code: Select all
local tabbed_pane = game.player.gui.top.add{type="tabbed-pane", name="tabbed_pane"}
local tab1 = tabbed_pane.add{type="tab", caption="Tab 1", name="tab_1"}
local tab2 = tabbed_pane.add{type="tab", caption="Tab 2", name="tab_2"}
local tab3 = tabbed_pane.add{type="tab", caption="Tab 3", name="tab_3"}
local label1 = tabbed_pane.add{type="label", caption="Label 1", name="lbl1"}
local label2 = tabbed_pane.add{type="label", caption="Label 2", name="lbl2"}
local label3 = tabbed_pane.add{type="label", caption="Label 3", name="lbl3"}
tabbed_pane.add_tab(tab1, label1)
tabbed_pane.add_tab(tab2, label2)
tabbed_pane.add_tab(tab3, label3)
Code: Select all
game.player.gui.top.tabbed_pane.remove_tab(game.player.gui.top.tabbed_pane.tab_3)
Code: Select all
game.player.gui.top.tabbed_pane.selected_tab_index = 2
If you click on the currently selected tab, it doesn't clear the issue, but it does update the selected_tab_index.
If you click on the tab 2, it then clears the issue and things are working again.