The Recommended Approach for a Dockable Cross-Platform UI for a C# Plug-in

Hi,

We have a large python script that we’ve developed over the last few years. It generates Kuka robot code based on Rhino geometry. The UI mechanism we developed was based on WinForms (this one). Over time we’ve gradually moved from using less python wrapper stuff to using RhinoCommon directly. And our inability to debug the UI was really painful.

We now want to take advantage of the full debugging power of Visual Studio and hopefully get a small speed advantage from using C#. So we are starting a rewrite (gulp). Given how much effort will go into this we want to make sure we are choosing a new method for developing UI that is the “best” way moving forward. By “best” I mean supporting the following:

  • The UI can dock in the Rhino UI, just like the Rhino Layer or Properties panels do.
  • Formally supported in future Rhino versions. We could probably start developing in Serengeti if necessary.
  • Cross-platform if at all possible. We have many students who are working on the Mac version of Rhino.

So I’ve read this thread (Cross-Platform Plugins with Xamarin). It talks about using Eto.

Is that the best way? If not what’s better?! Where can I find the best sample code to look into? Any recommendations from the Rhino development team in this regard is greatly appreciated!

Mark

Hi Mark,
For the ‘long run’, I would say that the article you referenced is the correct approach to take. Eto is the user interface toolkit that we are supporting on both Rhino for Mac and in future versions of Rhino (i.e. Serengeti). We’re still working out the details ourselves on how to best develop using this UI toolkit on both platforms, but I can say it is a toolkit that we are sticking with and further enhancing.

Unfortunately as it stands it is not as easy to use Eto in V5 for Windows (especially in the context of docking user interface.)

Regarding the “dockable” part: is it possible to dock Eto panels in Rhino for Mac or is this against some Mac UI guidelines?

My Eto.Forms.Panel can be docked in Windows as expected but floats around in Mac as a window without the possibility to attach it anywhere. Is this the intended behaviour on Mac?

I don’t believe we have any support for docking on Mac yet.