Eto forms and Python: Does it work?
Yes, works great!
I just started my Eto Python journey a few months ago in IronPython2 with the new script editor in R8 and more recently I’ve been using Python3 for all my Eto stuff.
I’ve made about 8 UIs that I’m pleased with, with more in the works
The thing with Eto is there isn’t much documentation once you get passed the predefined controls you can use.
Creating all your own custom classes and such is a lot of work but it gives you great control over the styling, functionality, etc.
So far the limiting factor has been me and not the frame work
Here are a set of guides and samples:
The Rhino.Python ETO guides above are based on @curtisw documentation on ETO which is more extensive.
Thanks for the link @scottd ,
I have been using this extensively and yes sorry when I said “lack of documentation” that wasn’t quite an accurate statement. As you have pointed out there is documentation on all of the methods, classes, etc.
As a non-programmer I’m always on the search for documentation paired with visual examples or downloadable example files to learn from as I have to dissect
These of course exist for the Eto Control in python found here:
And here is a great diagram example (this was the first thing that helped me understand what Eto was doing):
When I realized that not all controls have enough control over styling, such as rounding of corners, shadows, special colors, special transparency effects, etc. I started digging into drawables and that is where I had the most difficultly finding examples outside of random forum posts (which were very helpful)
I’d love more documentation on drawables like “here is a special shape drawn” “here is custombutton with a custom highlight border” “here’s how to create a transparent form” “here’s how to create a UI background with rounded corners” etc.
Thankfully the gaps here were filled in with existing forum posts and helpful users on these forums assisting me with each bit and piece.
I appreciate all the work that has gone into the Eto framework and existing documentation, I just think the default controls are very limited in terms of modern UI styling opportunities in comparison to projects being created in UI specific design applications like Figma. I’m not saying Eto needs to have parity with Figma but if you want to design anything outside of the “rhino default UI style” or “windows / mac default style” you exclusively need to use drawable, custom controls (unless I’m missing some kind of overrides on Eto.Controls)
And I think that’s okay as a lot of users likely don’t need any “pretty” UIs but for those that do, I think it’s not immediately clear what is even possible in Eto which, when paired with Drawables and Rhino.Display / Eto.Drawing is basically anything you can imagine UI wise. Which is really exciting!
Sorry I realize this goes off topic from the original post,
Thanks for the conversation!
Great feedback. I think we solved the off topic problem. So, feel free to go down the ETO rabbit hole on this thread.
Agree! I’m off and running learning Python thanks to everyone’s help. I’m looking way ahead as far as ETO goes but anything shared here will be super helpful if/when I reach that stage.
I dabbled a bit in ETO forms. In C#. I found the resources extremely limiting. The ETO structure itself seemed pretty good. I also tried out an accounting program made with ETO and it’s done really well. The Python documentation seems way more thorough for whatever reason. Python is way more popular and hence there are many more examples.
Is it possible to use Eto forms outside of Rhino (with Python not C#)? I’m trying to figure out how to find/install a package or library.
I’m learning Tkinter but just to practice python. Having a UI helps somewhat with the learning… that is if you don’t get caught up in learning the UI itself. Tkinter is pretty easy so it works well for that.
I’m not super familiar with the .Net eco system, but don’t know of anything that will work straight out of the box as well as Eto does with Python in Rhino. It is technically possible (as Rhino has proven), and Eto is open source (below, BSD-3). But it could easily just be far more work than simply picking a different GUI framework. And your user has to install some sort of .Net application that the Eto library and app runs in. Rhino has that environment for Rhino users obviously, but it’s also done a lot of behind the scenes work to let plug-in IronPython code call into C# (and even VB).
A IronPython/C#/VB bridge, either similar or maybe via PythonNet and CPython, would be the obvious thing for any other non-Rhino runtime/env to attempt. If nothing else that runs on .Net or Mono has already built one, then I don’t think Python coders should pick Eto outside of Rhino.
[Edit] There’s a Hello World app in regular Iron Python here: https://groups.google.com/g/eto-forms/c/14nV11Z_hSk As I said above: technically possible, but definitely niche.
Thanks James!
I definitely want to avoid niche as I’m finding that I’m needing to pick and choose my learning resources when it comes to learning to code. That was one of the main reasons I switched (am switching) from C# to Python.
Since my last post I’ve actually decided to explore Kivy - I just needed something fun to play around with while I come to grips with Python and was starting to not like Tkinter. It would be nice to learn only one GUI (Eto) but that’s not always an option. Kivy looks like something I can actually make something useful out of someday too.
You’re welcome Keith. All these frameworks promise a lot, but I’ve not used them (other than in-Browser UIs). Kivy’s not going to disappear, and has lots of support. My argument was from a position of ignorance about .Net, but there’s a lot wisdom in choosing Kivy or anything that doesn’t require your users to install Iron Python.
If you use CPython just use the module pythonnet
to consume .NET libraries like Eto.Forms.
This is how Python 3 integration happens in Rhino, via CPython 3 + the pythonnet
module.