[IronPython] Running applications vs. forms?
Nathan R. Ernst
ernsnat at iit.edu
Sat Jun 17 13:53:10 PDT 2006
The object you pass to Application.Run should derive from Form, not
Application. In your example below, you should eliminate the class MyApp
and pass either Form1 or Form2.
-Nathan
_____
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder
Sent: Saturday, June 17, 2006 3:34 PM
To: users at lists.ironpython.com
Subject: [IronPython] Running applications vs. forms?
To clarify my earlier message-
If I want to create a non-trivial application, I will have several forms and
dialogs. My(apparently broken) understanding is that I would create a class
representing the application and pass that to the Application.Run(method).
For example, the tiny app here:
import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Windows.Forms import Form,Application
class Form1(Form):
pass
class Form2(Form):
pass
class MyApp(Application):
pass
a = MyApp()
Application.Run(a)
Produces 'TypeError: cannot derive from sealed or value types'.
Alternatively, If I create a class with no inheritance, I get 'TypeError:
bad args for method'. What is the correct way to do this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/users-ironpython.com/attachments/20060617/57179418/attachment.htm
More information about the users
mailing list