Re: [Pyobjc-dev] How do I learn PyObjC 2 in Leopard?
Brought to you by:
ronaldoussoren
|
From: Ronald O. <ron...@ma...> - 2007-12-23 08:25:01
|
On 20 Dec, 2007, at 19:48, Bill Bumgarner wrote: > On Dec 20, 2007, at 8:15 AM, Jon Rosebaugh wrote: >> I did figure out where to get IBOutlet and IBAction, but my >> ConverterController (I'm following the Currency Converter tutorial) >> doesn't seem to be working. When the app starts up, it puts this in >> the console: >> 12/20/07 10:09:29 AM Python Converter Converter[9448] Unknown class >> `ConverterController' in nib file, using `NSObject' instead. >> 12/20/07 10:09:29 AM Python Converter Converter[9448] Could not >> connect the action convert: to target of class NSObject >> and then obviously clicking the convert button doesn't do anything >> at all. >> >> Here is my ConverterController class: >> >> class ConverterController(NSObject): >> amountField = objc.IBOutlet() >> dollarField = objc.IBOutlet() >> rateField = objc.IBOutlet() >> >> @objc.IBAction >> def convert_(self, sender): >> print "Hello World" >> self.amountField.setFloatValue_(self.dollarField.floatValue() >> * self.rateField.floatValue()) >> self.rateField.selectText_(self) > > Make sure you import the file containing the ConverterController class > in your main.py. Is that something that can/should be automated? Either by running a macro when Xcode adds a new file (which afaik isn't possible, but you never know), or by having main.py do an os.listdir of the Resources directory and try to import everything that resembles a python module. Ronald > > > b.bum > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |