PyPy.NET goes Windows Forms
Briefly

PyPy.NET goes Windows Forms
"After having spent the last few days on understanding PyPy's JIT, today I went back hacking the clr module. As a result, it is now possible to import and use external assemblies from pypy-cli, including Windows Forms"
">>>> import clr >>>> clr.AddReferenceByPartialName("System.Windows.Forms") >>>> clr.AddReferenceByPartialName("System.Drawing") >>>> from System.Windows.Forms import Application, Form, Label >>>> from System.Drawing import Point >>>> >>>> frm = Form() >>>> frm.Text = "The first pypy-cli Windows Forms app ever" >>>> lbl = Label() >>>> lbl.Text = "Hello World!" >>>> lbl.AutoSize = True >>>> lbl.Location = Point(100, 100) >>>> frm.Controls.Add(lbl) >>>> Application.Run(frm)"
"Unfortunately at the moment you can't do much more than this, because we still miss support for delegates and so it's not possibile to handle events. Still, it's a step in the right direction :-)."
PyPy's clr module now enables importing and using external .NET assemblies from pypy-cli, including System.Windows.Forms and System.Drawing. The clr.AddReferenceByPartialName function can load assemblies and specific classes like Application, Form, Label, and Point can be imported. Sample code demonstrates creating a Form, adding a Label with text, autosizing and positioning it, and running the application loop with Application.Run. Delegate support remains missing, preventing event handling and interactive callbacks. The feature provides basic GUI capability on pypy-cli and marks progress toward fuller .NET interoperability.
Read at Antocuni
Unable to calculate read time
[
|
]