Skip to main content

TabSet

See the TabSetDemo class.

if (Gui.TextButton("Add Tab"))
{
// Adds a new tab with the next index as its label
tabs.Add(tabs.Count.ToString());
}

if (Gui.TextButton("Remove Tab"))
{
// Removes the last tab
tabs.Remove(((tabs.Count - 1).ToString()));
}

// Begin drawing the TabSet.
if (Gui.BeginTabSet(tabs.Count))
{
for (int i = 0; i < tabs.Count; i++)
{
// Begin drawing the Tab.
// Must be executed between BeginTabSet() and EndTabSet().
if (Gui.BeginTab(tabs[i]))
{
Gui.Text($"{i}");
Gui.EndTab();
}
}

// End the TabSet.
Gui.EndTabSet();
}