Third-party GUI libs

Hello

Is it possible to use other GUI libraries in the Rhino like Qt or wxWidgets or similar?
Or due to difficulties with integrating its message queue with Rhino one makes this almost impossible?

It makes sense for us in regard to porting it to Mac

Hi,

I am copying @stevebaer and @Alain, as they have worked on this subject earlier.

The message pump is rather an issue, even when using Windows Forms from .Net in Rhino. That being said, were you thinking about this for the interface to a specific plug-in, or for a complete skin? My understanding is that using other libraries is discouraged because of limitations, but it might also be dependent on the type of project on which you are about to embark.

Also, unless the scope is rather limited, I fear that having at least some platform-specific UI code is almost unavoidable at present, given the state of the projects. Rhino for Win and Rhino for Mac are two distinct products, technically.

Thanks,

Giulio

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

Hi,

I think there are .Net bindings for Qt but are you using the C++ SDK? I don’t know what the native SDK on the Mac will look like.

Unless you absolutely need C++ then using .Net and RhinoCommon will probably be the easier option for writting plug-ins that’ll run on both windows and the mac. But with .Net there’s still the issue of the GUI … there are no good cross platform options right now. Like Rhino for Windows and Rhino for Mac have different GUIs to take advantage of each platform in many cases it’s probably a good idea to do the same with your plug-ins.

If you’re using C# a MVVM (Model View ViewModel) framework will help in making your platform specific GUI as thin as possible. On windows you’d use WPF where the XAML and “code behind” (View) are platform specific. A lot of the code that you’d normally write in the “code behind” can be written in a “view model” and that code can be shared. On the Mac the platform specific View is created with InterfaceBuilder & Xamarin Studio (w/ Xamarin.Mac) to create the “XAML + code behind” Windows equivalent. The rest of your code (business logic, model, file IO, RhinoCommon API, etc) can all be cross platform.

I hope that makes sense …

We don’t have a proper SDK for Mac Rhino, but when we do the first one will probably be .NET based. I would just recommend separating your GUI from your logic as much as possible. Making your code callable from .NET will help keep this separation and will also have a bonus side effect of making your plug-in callable from python and grasshopper.

I think some developers have used Qt, but I expect to start seeing DLL hell issues if many more start using that toolkit.

I’m using QT in my plugin developed for Windows.
For now I have not found problems and I can use all QT features.

@ceruti would you have a small example project using rhino and qt anywhere online for reference.

Thanks a lot.