system
March 8, 2018, 2:09pm
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
websterek
Hello!
How can I show popup menu from my docked plugin panel.
Right now I have bunch of operations realised after clicking button but one of them need more options and I would like to ask user with popup window.
I’am trying to use simple code where dock is (like in official tutorial) my instanced scene with plugin interface:
func GeneratePaths():
dock.get_node("Popup").show()
print('clicked')
here is my tree:
system
March 31, 2018, 9:33pm
2
Reply From:
gswashburn
I used a RMB (right mouse button) option signal and then set the rect_position to my global mouse position. That way the popup menu extended down from where the user clicked. (Context Menu)
$menu/Tree/Menu.rect_position = get_global_mouse_position()
$menu/Tree/Menu.visible = true
$menu/Tree/Menu.popup()
I don’t see where you are setting the popup to visible in your code and you are using show() instead of popup(). Try this:
func GeneratePaths():
dock.get_node("Popup").visible = true
dock.get_node("Popup").popup()
print('clicked')