Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | patatra |
Hye everyone,
I am making an Addon and I have created a MenuButton. Every time I restart Godot, the items in the PopupMenu of the MenuButton multiply. The code is simple.
func _ready() -> void:
init_FileMenu()
func init_FileMenu() :
var menu = fileMenu.get_popup()
menu.add_item("New Tree")
menu.add_item("Open...")
menu.add_separator()
menu.add_item("Save")
menu.add_item("Save as")
menu.add_separator()
menu.add_item("Close")
menu.add_item("Close all")
menu.connect("id_pressed", self, "_on_file_menu_pressed")
Good Day,