ETO forms examples not working/crashing

I’m trying to get a handle on using eto forms in python, but ran into an issue. I’m going through the VERY helpful eto guides here created by @CallumSykes , but when I got to the page of Cells examples, none of the sample scripts work here. Is there an issue with the scripts or is it something I’m doing wrong?

For instance, if I run the TextBox Cell example, the textbox shows the header text (Key and Value) but none of the other text. And sometimes, clicking the textbox crashes Rhino.

I’m running them all from Rhino 9’s script editor as Python 3 scripts on Windows.

Do the C# examples work? Does the Python code work in IronPython if it’s backported to be Python2 compatible?

Eto’s a .Net library. The embedded IronPythons run directly on Rhino’s .Net. So I would’ve thought Eto runs a lot more reliably in IronPython.

Rhino’s CPython3 is a Pythonnet bridge of CPython. Despite however well passing a .Net library to CPython, to the Pythonnet Bridge, back down to .Net happens to work in some circumstances (good for you if so, but don’t build any more than necessary on top of that), it is a whole bunch of extra unnecessary moving parts, and as well as being inefficient, they break easily.

I had a look @phcreates and found some issues, as you described. I re-ran everything to check and made some fixes. Reload the page and let me know if you have any further issues :slight_smile:

Thanks - That seems to fix it!

And I don’t really have a concept of how Python 3 is connected to Rhino vs how Python 2 is connected, but does @James_Parrott have a point and should I just try to use Python 2 when working with ETO or is Python 3 fine?

There are definitely some benefits to IronPython, it certainly works better with .NET than Python 3. I created these docs because Python 3 is a bit less obvious with Eto and I wanted better samples out there. That being said, Python 2 is depreciated and has been for 6 years now, IronPython hasn’t had any updates for 4 years. If you intend to use an external library, you may need to use Python 3.

IronPython 2 hasn’t, but IronPython 3.4.2 was released in December 2024 :eyes:

Sorry yes I should have specified IronPython 2, thankyou for clarifying! :slight_smile: