Re: [Pyobjc-dev] bugs found while getting started
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2002-12-07 15:36:43
|
Brian, Thanks for your feedback. On Saturday, Dec 7, 2002, at 07:46 Europe/Amsterdam, Brian Slesinsky wrote: > > - modules.m doesn't compile on a UFS filesystem because the #include > for NSAutoreleasePool.h has the wrong case. > > - HelloWorld.pm doesn't work unless I add "import AppKit" at the top. We obviously don't use HelloWorld.py ourselves. Using "import AppKit", or even better 'from AppKit import *; from Foundation import *' instead of the calls to lookUpClass, is the right way to load the AppKit framework. This used to work until several weeks ago due to a bug in the setup.py script. > > - INSTALL claims that you need python 2.3, but setup.py checks for > python > 2.2, and it seems to work so far. Python 2.2 works just fine, INSTALL should be updated. > > I haven't tried anything else yet - what are good examples to try? That depends on what you want to do with PyObjC - TableModel is a simple GUI with a NIB file - TableModel2 is the same program, but now as a Project Builder project - WebServicesTool and Todo are more complicated GUI projects The various python files in the Examples directory show some features of PyObjC and are mostly code snippets that were used for testing the module. The documentation is far from complete, but the following rules for translating from Objective-C should take you a long way: - Instead of '#import <AppKit/AppKit.h>' do 'from AppKit import *' - Likewise for Foundation.h - Paste all elements of a method together and replace colons by underscores to get the Python method name (e.g. insertObject:atIndex: is insertObject_atIndex_ in Python). - Python dicts can be used where NS(Mutable)Dictionaries are expected - Python lists can be used where NS(Mutable)Arrays are expected Ronald |