Eto user interface with python


(Scott Davidson) #1

@clement - Are you trying to check on existing forms in Windows or looking to do your own corss platform dialogs? We have the Eto.Forms in Python. There is a first draft of a guide for Eto and Python here: http://developer.rhino3d.com/guides/rhinopython/eto-forms-python/

The pre-canned dialogs are covered here: http://developer.rhino3d.com/guides/rhinopython/python-user-input/

The guides are still quite raw, but perhaps that helps?


Trouble importing csv data
Trouble importing csv data
#2

@scottd, i’ve seen the example of course and appreciate it that there will be a cross platform for creating dialogs. Atm. this does not help me much as i have to develop for V5 and V6 and Mac, so i think i stay with WinForms for the windows side and later port all dialogs to ETO for the Mac side when required…which is going to be hard without a visual editor. Currently i use SharpDevelop which works fantastic, almost zero typing and all drag & drop.

While searching online i’ve found some examples using WinForms 2.0 with Mono and IronPython. Does this still work in current Mac OS ?

Btw. will ETO get an equivalent of System.Windows.Forms.ListView(), support for modeless dialogs or a function like Rhino.UI.Dialogs.PushPickButton() ?

_
c.


#3

Hi Clement,

this should be possible:

Jess


(Steve Baer) #4

Your approach makes the most sense for now. Once V6 is released, then porting may make sense if you want your scripts to run on Mac. If you are only concerned with Windows, then continuing to use WinForms will work just fine in V6.

We have a admittedly very poor port of WinForms for Mac which really isn’t worth considering for the long run. Even WinForms on Windows is showing it’s age and some areas like high DPI support are still being fixed by Microsoft.

We probably won’t have a visual editor anytime soon, but we are hoping to have some sort of previewer over time where you can immediately see the UI update as you type. I’m also hoping (now were talking about code that doesn’t even exist yet) to create a python package that makes working with Eto much more “pythonic”.

I think the ListBox is what you are looking for as a replacement for System.Windows.Forms.ListView

Sure (https://github.com/picoe/Eto/wiki/Controls). A Form is modeless and a dialog is modal

This is implemented in an assembly we ship named Rhino.UI. I’ll need to figure out how to make this easily callable from python


#5

Hi Jess,

thanks, i’ll try what i can do using python. Many of the dialogs are in place already using WinForms and a few things are missing in ETO which are required. Since i do not have a mac here, what happens if you run this on mac rhino?

import clr

clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Form

class Form1(System.Windows.Forms.Form):

    def __init__(self):
        self.Text = 'Simple'
        self.Width = 250
        self.Height = 200
        self.CenterToScreen()

form = Form1()
form.ShowDialog()
form.Dispose()

_
c.


#6

Thanks @stevebaer for your answers. There is ListView and ListBox under WinForms. I use ListView which is basically a complex multirow / multicolumn table with dynamic fields which must be user editable for my purpose.

I use PushPickButton a lot in a modal WinForm, so i can get objects or pick points after the form has been opened and quickly can get back to it. I never tried it with an ETO form yet. But all examples are welcome :slight_smile:
_
c.


(Steve Baer) #7

It may be a GridView that you want to work with; depends on the situation. If you look at the PlugInManager or AdvancedSettings user interfaces, those are Eto GridView implementations.


#8

Thanks @stevebaer, i’ll look into it.
_
c.


#9
Exception Occured
Message: The requested feature is not implemented.

Traceback:
  line 10, in __init__, "/Users/fakepath/WindowsFormDialog.py"

No idea why. Same with the other samples on http://zetcode.com/tutorials/ironpythontutorial/firststeps/
Ready to test more…


#10

@Jess many thanks for testing. These must be the dragons @stevebaer mentioned :wink:

_
c.