Closing a form created with ghpython closes grasshopper

How can I make it so it doesn’t close grasshopper but only the form?

image

ContextMenuItems.gh (4.4 KB)

You should use form.Show() I think?

Where?
instead of Application.Run(form)?

Update: Yes it works, thanks @gankeyu

Application.Run creates a brand new message loop on the current thread, which may result in resource problems since two loops are available after the method. However, you should use Application.Run if you are creating the window on another thread.

1 Like

I was about to ask about multi-threading in ghpython, but I’ll do it as a separate topic if I cannot find enough info searching the forums.