Eto.Forms setup for IronPython in VS2017

97 views
Skip to first unread message

will....@gmail.com

unread,
Dec 27, 2018, 12:17:24 AM12/27/18
to Eto.Forms
Is there a way to set up the IronPython environment of visual studio 2017 to use Eto.Forms?
I've had success using Eto.Forms in 3d modeling software Rhino
Now I'd like to experiment with building windows apps with Eto.Forms
Less complicated than WinForm for a noob like me...

curtis

unread,
Jan 9, 2019, 12:55:37 PM1/9/19
to Eto.Forms
Hey Will,

To run Eto.Forms apps with IronPython, you simply need to add Eto.dll and Eto.Wpf.dll to your project.  You can get these from the nuget packages that I've linked, which are just zip files.  Then, the following should work as a starting point:

import clr
clr
.AddReference('Eto')
clr
.AddReference('Eto.Wpf')

from Eto.Drawing import *
from Eto.Forms import *

class MyForm(Form):
   
def __init__(self):
       
# Create child controls and initialize form
       
self.Content = Label(Text = "Hello IronPython")

app
= Application()
app
.Run(MyForm())


If you want to create a standalone .exe that you can distribute, you may be able to wrap the python code in a C# application that executes via the IronPython interpreter.

Hope this helps!
Curtis

Slide

unread,
Jan 9, 2019, 1:09:15 PM1/9/19
to eto-...@googlegroups.com
The ipyc compiler would work for creating a "standalone" executable. It's part of the install, but not part of the nuget packages.

--
You received this message because you are subscribed to the Google Groups "Eto.Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eto-forms+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eto-forms/b633e789-6671-41d3-8651-0b29e96bad64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Reply all
Reply to author
Forward
0 new messages