SemiModal Dialog with Eto?

Hello,

I am just getting into Eto with python to make a gui for a grasshopper project.

Is there any way to open the dialog so that it is a semi modal window and can be used simultaneously with Grasshopper/Rhino?

Hey @nicholas.ziglio,

Try using a Eto.Forms.Form class with its Topmost property set to true. This has the caveat that the window will be on top of all windows even when you switch to another application.

Another option is to just set the Form.Owner property to Rhino.UI.RhinoEtoApp.MainWindow or to Grasshopper.Instances.EtoDocumentEditor, which makes the form always on top of either of those windows only.

In newer versions of Rhino, there is also a Eto.Forms.FloatingForm class which is probably more like what you’re looking for. It stays on top of all rhino windows while allowing interaction with other windows, then hides when Rhino is not the active application.

Hope this helps!
Curtis.

2 Likes

Thank you Curtis! The last class sounds like it indeed. I’ll try it out soon.

Are there any examples for this?

There are very helpful examples here on how to create a custom dialog but I could not find anything on creating custom floating forms (or just forms that behaves similar to dialogs but allowing interaction with other windows)

Cheers,
Simon

1 Like

@curtisw in addition to Simon’s query are there implementations of this in C#?

Thanks,
Kane

Hi @Kane_Borg,

To show a semi-modal dialog with Eto, you can do something like this:

var dialog = new MyDialog();
var rc = dialog.ShowSemiModal(doc, RhinoEtoApp.MainWindow);

The developer samples repo on GitHub has a sample you can try.

– Dale

1 Like