This is broken.  Unfortunately, you should assume that in IronPython 0.7.3 you 
can't override any methods from a CLS super type so that it will be seen from 
the CLS side.

FYI - It is possible in IronPython 0.7.3 to override a very small set of 
methods from a CLS super type in such a way that other CLS languages will see 
and be affected by those overrides.  Looking over the code, the set of methods 
that work for this are exactly those needed to run the parrotbench benchmark - 
no more and no less.

Now that you've reminded us of this issue, fixing the bug is high on our 
priority list and I'd expect this to be fixed in the next 1-2 weeks for 0.7.4.  
The basic design is in place to make this work for int.__cmp__ and a few other 
key methods so the work is just to extend that design to cover the general case.

Thanks - Jim

________________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kirk Olynyk
Sent: Monday, April 25, 2005 11:54 AM
To: users-ironpython.com@lists.ironpython.com
Subject: [IronPython] Overloading OnPaint etc.

Under C#, you can overload OnPaint on a class derived from Form and then it 
will automatically be called upon the paint event. I find that under IronPython 
that I am forced to explicitly add the OnPaint method to the paint message 
handler list. Is this by design?
 
import sys
sys.LoadAssemblyByName("System")
sys.LoadAssemblyByName("System.Drawing")
sys.LoadAssemblyByName("System.Windows.Forms")
 
from System import *
from System.Windows.Forms import *
from System.Drawing import *
 
class HelloWorld(Form):
    
    def __init__ (self):
        print "HelloWorld.__init__"
        self.Text = "Hello World"
        self.BackColor = Color.White
        self.Paint += HelloWorld.OnPaint        # not necessary in Csharp
    
    def OnPaint (self, pea):
        print "HelloWorld.OnPaint"
        grfx = pea.Graphics
        grfx.DrawString("Hell, Windows Forms!", self.Font, Brushes.Black, 0, 0)
 
Application.Run(HelloWorld())
_______________________________________________
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to