0 votes

Tab container is almost perfect but there is a flaw. You can't customize the name of the tab in real-time.
Does anyone know how to customize the tab's name real-time?

Godot version 3.3
in Engine by (380 points)

What do you mean? The name of the tab changes to match the name of the child node.

2 Answers

0 votes

Someting like this:

onready var tabs:TabContainer = $TabContainer

func _ready():
    tabs.set_tab_title(0, "Tab 1")
    tabs.set_tab_title(1, "Tab 2")
by (628 points)
0 votes

Here's my solution from a previous question:

You can use tab_selected(int tab) signal from each tab and trigger a one shot timer whenever a click event is received. If a click occurred while the timer is active (double click), popup a dialog that contains a LineEdit, confirmation button and a cancel button. when the user confirms, use set_tab_title() to edit the title.

Make sure you pass up the tab number from tab_selected(int tab) so that you know which tab to change its title.

by (288 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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.