Edit tab container's name in game

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

I want to make a feature where if you click a tab, you can focus it and modify its title to your will. Is there any way I can make a changeable text??

:bust_in_silhouette: Reply From: Bubu

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), make a pop-up 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.

This approach looks a bit different (and kind of old-school), but it’s simpler to code.