Eto support in all Rhinos

eto

#1

Continuing the discussion from User data entry in scripts:

Eto appears to be part of Mac-Rhino and Win-Rhino WIP. It would be great if Eto will also be supported from Win Rhino V5 in future service releases. Then we could develop complex user interfaces which work cross-platform and cross-version without any hassle for the users.

Do you think this is possible / will happen? @curtisw @stevebaer


(Steve Baer) #2

It is possible, but I’m not sure how likely this is to happen. We are very late in the service release cycle for Rhino 5 and just ‘bundling’ Eto with V5 does not completely solve this issue. There is a small amount of Eto initialization that has to occur at start-up and I really don’t want to introduce more dependencies to V5 at this point in time.

The other way to solve this is to bundle Eto with your V5 plug-in or script and call the initialization code yourself.


#3

I hope that Eto dialogs become popular and common soon! To make this come true all scripts should run cross-platform on Mac and Windows. I’d like to avoid that each Windows Python script which includes a dialog comes with a separate Eto bundle and/or needs a different script version.

Maybe this could be solved by a custom installation of Eto? So we can send the users to a Wiki-page with all the instructions to install it. Just some early thoughts… V5 on Windows will be the main Rhino for a loong time…


#4

I would be interested in that custom installation of Eto on Rhino 5 too.


(Steve Baer) #5

Interesting idea, though I’m not sure if adding confusion by forcing users to get a separate download would makes things better or worse.

This could be done with a basic C# plug-in that includes the Eto Dlls and initializes Eto when loaded.


Eto user interface with python
#6

Sure it would be better if Eto were supported “out of the box” :smiley:

I’m experimenting with an interface for custom user-data and Eto seems to be the perfect tool with it’s table like structures. I’m far from anything useful (for the lack examples), but once that works I’m sure everyone wants to have it - and I’m also sure that everyone wants to customize it. Also great for Excel / csv files…

I see a lot of new developments for Rhino, but only a few “insiders” have the chance to really get into these. The developers do not have the time to document their work or write some examples which may help the “semi-professionals” to use all that beautiful stuff. Community on idle… if everything is put into plug-ins.

I thought you were an open source fan? :wink:


(Steve Baer) #7

Believe me, we’re working on improving that situation :wink:


#8

Steve,

Is there anyway to get an example of this? I have also been maintaining a custom user data plugin that uses the rhino panel and docking, however I cannot seem to initialize an Eto form as it does not follow win32 interfaces, it fails when I attempt to register it at plugin initialization.

Rhino.UI.Panels.RegisterPanel(this, panelType, “Sample”, System.Drawing.SystemIcons.Question);

Something like Dales Sample User Panel or a hint at that with Eto would be very helpful.
https://github.com/dalefugier/SampleCsPanel


(Steve Baer) #9

I’m sorry but we don’t have a sample at the moment (we actually haven’t even attempted to create an Eto panel in V5, but we do know this would work). @curtisw may have some hints.


#10

I don’t know that we need a full example but something to get us going would be greatly appreciated.We are utilizing DataGridView along with custom column drawing. If we want to port to OSx this will all need to be rewritten, having the same code working on both Windows(v5) and OSx(v5) would allow us to do this.

We have had the thought of simply opening a form and not attempting to dock with Rhino Tabs but this is plan B.


#11

The current issue is to get the panel started in Rhino. Please see the attached image. Some help would be great.

Christian


(Dale Fugier) #12

Here is an example that demonstrates how to display an Eto form in a docking panel.

Word of warning: all this will change in Rhino 6, as it includes the Eto binaries and we’ve done some work to make this easier.


#13

Thanks Dale


#14

Wow. Thanks Dale. This is great. Let’s see if we get it to work.


#15

So we got this panel to work. Thanks again. We are wondering how to get the menubar to add to the panel. The example we found:

doesn’t work. Seems like this only works for Modal and Modeless Forms.

Any help would be great.

Thanks in advance
Christian


(Lukasz Domagala) #16

This might be a silly question but is Eto accessible from python script (can’t find Eto namespace in python editor) or only c#? I’m asking about Windows Serengeti


Create Windows Form
(Steve Baer) #17

Yes, it is accessible from python script and we do plan on making this easier in general to work with from python. I believe @curtisw was looking into this last week.


(Lukasz Domagala) #18

Oh OK I found it…


#19

@stevebaer, is there any news about using python + ETO in V5 ? I can use ETO in V6 but when i try below in V5, it seems to import the whole namespace properly:

import clr, sys

sys.path.append(r"C:\Program Files\Rhino WIP\System")
clr.AddReference("Eto.dll")
from Eto.Forms import *
from Eto.Drawing import *

…but once i try to create a dialog or a form using:

form = Dialog()

I get this error:

Message: Platform instance is null. Have you created your application?

_
c.


(Steve Baer) #21

I love it; super hacky :slight_smile:

@curtisw is going to have some better techniques than me, but you might want to try adding the following to your script

platform = Eto.Wpf.Platform()
app = Eto.Forms.Application(platform)
app.Attach()

You’ll probably need to do something like use sticky to hold on to the fact that you initialized the app.