How to add a close button to each tab with TabContainer?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By estebanmolca

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.

:bust_in_silhouette: Reply From: estebanmolca

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:

add_tab (“tab1”)
add_tab (“tab2”)

And to show the close button on the selected tab:

set_tab_close_display_policy (CLOSE_BUTTON_SHOW_ACTIVE_ONLY)

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