On 9/16/06, Steve Majewski <sdm7g@...> wrote:
> Although Cocoa-Java seems to be deprecated and they are not going to
> add new Cocoa features
> past 10.4, the plumbing still seems to be there:
> Jython 2.2a1 on java1.5.0_06 (JIT: null)
> Type "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> sys.path.append( '/System/Library/Java/' )
> >>> from com.apple.cocoa import *
> >>> dir()
> ['__doc__', '__name__', 'application', 'foundation', 'sys']
> >>> dir(application)
> ['NSActionCell', 'NSAffineTransform', 'NSAlert', 'NSAlertPanel',
> 'NSAnimation', 'NSAnimationEffect', 'NSApplication',
> 'NSArrayController', 'NSBezierPath', 'NSBitmapImageRep', 'NSBox',
> 'NSBrowser', 'NSBrowserCell', 'NSButton', 'NSButtonCell',
> 'NSCachedImageRep', 'NSCell', 'NSCellForTextAttachment',
> But I've never actually tried to use any of this stuff. Don't know
> how well it will work from jython.
> And it's only useful if what you want pyobjc for is Cocoa
> ( foundation + appkit ), not some other objc library.
> And it likely only works via rosetta on Intel Mac's if it works at all.
> [ Deprecation of JDirect and Cocoa/Java was announced years ago, but
> I suspect that the intel transition
> is the final nail. But I'm doing mostly server-side Java now, so I
> don't know what is current best practice
> for Mac client apps. Check out the cocoa-dev list as lists.apple.com. ]
I'd stay very far away from Cocoa-Java...
> What exactly do you want to do ?
> What most folks want from Java is platform portability, which usually
> means they don't want to restrict
> themselves to something like Cocoa. However, what most folks seem to
> want out of Jython is access
> to some Java useful java libraries. Depending on what you want, there
> may be a better way to get there.
Jpype is supposed to do this with regular C Python: