Topic was automatically imported from the old Question2Answer platform.
Asked By
Rokkimies
Old Version
Published before Godot 3 was released.
So the MenuButton will bring up a popupmenu, how do you track if an item in the menu is clicked?
Normal popupmenus will track events, for example pressed or motion, but so far I haven’t been able to get ANY event from MenuButton’s PopupMenu. If I attach a script in MenuButton the func _input_event(event): only tracks what happens with MenuButton, but the popupmenu itself is completely ignored.
This makes me wonder why is popupmenu generated by MenuButton working completely different than normal popupmenu, they are same thing, right?
I’ve read the documentation and forums through, spent around 3 or 4 hours on this now. There’s literally nothing on any forum and documentation doesn’t answer to anything.
Help would be appreciated. Even knowing that MenuButton generated popupmenu is useless would have saved me hours.
Oh, thank you! But you make one mistake. Not item_pressed.The signal is called id_pressed
Ezillo | 2017-10-18 17:18
This: get_popup() says it is non-existent and apparently rthis is the only way? OMG im so frustrated, 3 weeks trying to make a simple popup work, this is bad, either Im a complete idiot, and I can make a popup work on other engines, or this is just weird.