Re: [Pyobjc-dev] How do I learn PyObjC 2 in Leopard?
Brought to you by:
ronaldoussoren
|
From: Bill B. <bb...@ma...> - 2007-12-20 18:48:22
|
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. b.bum |