The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

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:
enter image description here

in Engine by (228 points)

1 Answer

0 votes

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')
by (204 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 Frequently asked questions and 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 [email protected] with your username.