0 votes

Just like the Google Chrome browser, I would also like to add a button to add a new one at the end of the tabs. I welcome any suggestions.

asked Nov 14, 2019 in Engine by estebanmolca (1,203 points)

1 Answer

+1 vote

I used a Tabs control which is simply like a button that doesn't depend on any child,
to align it to the top I put it inside a VboxContainer.
To add new tabs (Contrary to the intuition of adding or duplicating the Tabs control) I using code:

addtab ("tab1")
add
tab ("tab2")

And to show the close button on the selected tab:

settabclosedisplaypolicy (CLOSEBUTTONSHOWACTIVEONLY)

I still have to see how to display a custom tab with the + symbol and not show the close button when clicked...

answered Nov 15, 2019 by estebanmolca (1,203 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.