How to make a ghpython component to open a form with double click on the component

Hi guys,

I am looking for a way to open an eto form with double click on a ghpython compiled component.
Any ideas are appreciated.

Thanks,
Alex

@piac

You will need to create a custom component attribute to override the onmouseclick behaviour and on the clickevent you invoke a new eto form by translating the example into IronPython https://github.com/picoe/Eto/blob/develop/README.md

The inside of Main() function is what is going to be executed within the onclick method.

But seriously, Eto is a :poop: framework, same as IronPython. If you like it weird, then move on. But you may also chose C# and WPF or at least use C# and Eto if you really need to support crossplatform.

Paraphrasing @TomTom, I would advise against writing a full-blown Eto form in IronPython in Grasshopper. There are simply no great tools to help with that. However, it is still possible. I think it would be wiser to choose a simpler setup, such a C# with Eto, as was eloquently stated.

Some simple Eto forms usage, such a message boxes or very simple controls, will also be a sustainable strategy with IronPython. However, I would still suggest never to show message boxes in Grasshopper.

I do not agree at all with the personal and objectionable opinion regarding the single frameworks, as they are both serving their stated purposes in a fantastic way.

Thanks,

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

1 Like

In particular, André Agi’s at Liljewall Arkitekter in Sweden uses Eto forms to show an HTML window that controls Grasshopper and shows GH results. More info in their presentation video.