[Pyobjc-dev] Cocoa from CPython+PyObjC vs. Jython
Brought to you by:
ronaldoussoren
From: Steven D. M. <sd...@mi...> - 2001-02-28 16:43:27
|
---------- Forwarded message ---------- Date: Wed, 28 Feb 2001 11:38:18 -0500 (EST) From: Steven D. Majewski <sd...@vi...> To: Finn Bock <bc...@wo...> Cc: jyt...@li..., pyt...@py... Subject: Re: [Jython-users] Re: [Pythonmac-SIG] Cocoa from Jython on MacOSX Resent-Date: Wed, 28 Feb 2001 11:39:50 -0500 (EST) Resent-From: "Steven D. Majewski" <sd...@vi...> Resent-To: sd...@mi... Resent-Subject: Re: [Jython-users] Re: [Pythonmac-SIG] Cocoa from Jython on MacOSX -- cut the irrelevant stuff about Jython+Java -- I was able to get a slightly modified version of one of my PyObjC AppKit test programs to work in Jython. The main difference is that the CPython <-> Objective-C bridge does a different name mangling than the Java bridge does. PyObjC tries to pythonify the objective-C method names -- for example the objective-c statement: [ win initWithContentRect:rect styleMask:mask backing:YES defer:NO ]; actually uses the message selector: initWithContentRect:style:Mask:backing:defer: which gets name mangled by PyObjC to: win.initWithContentRect_styleMask_backing_defer_ (frame, mask, YES, NO ) but Jython gets to use the Java bridge's use of Java overloading of different polymorphic versions of the same method name (so there are a couple of different initWithContentRect 's with different numbers of args. ). In Jython: win.initWithContentRect( frame, mask, YES, NO ) ( I don't know yet what happens when there are are two objective-c methods with the same number but different args. ) I think there was some discussion on the old pyobjc-sig mailing list on whether or not to attempt this sort of overloading or to keep the more explicit name transformation. We may wish to revisit this decision -- it would be nice to have the same Cocoa bindings for Jython and CPython+PyObjC. -- Steve Majewski |