Unable to attach actions in Python/Cocoa
Unable to attach actions in Python/Cocoa
- Subject: Unable to attach actions in Python/Cocoa
- From: Jose R.C.Cruz <email@hidden>
- Date: Mon, 4 Feb 2008 13:49:29 -0800
2008 Feb 04, 13:04 PST
Hello, folks.
I am using Xcode 3.0 to build a basic BMI calculator in PyCocoa.
Right now, I got the following class built on Xcode.
----- START OF BMICalculate.py
from Foundation import *
from AppKit import *
import objc
class BMICalculator (NSObject):
fld_bmi = objc.IBOutlet()
fld_height = objc.IBOutlet()
fld_weight = objc.IBOutlet()
pop_height = objc.IBOutlet()
pop_weight = objc.IBOutlet()
@objc.IBAction
def doCalculate_(self, sender):
NSLog("You just clicked on the Calculate button")
----- END OF BMICalculate.py
Now, I did bind the action doCalculate to the Calculate button using
Interface Builder. But when I built and run the project, I get the
following errors on the Console window.
----- Start of Console messages
[Session started at 2008-02-04 12:33:07 -0800.]
2008-02-04 12:33:23.426 BMI[723:10b] Unknown class `BMICalculator' in
nib file, using `NSObject' instead.
2008-02-04 12:33:23.494 BMI[723:10b] Could not connect the action
doCalculate: to target of class NSObject
2008-02-04 12:33:24.516 BMI[723:10b] Application did finish launching.
The Debugger has exited with status 0.
----- End of Console messages
Am I missing something here? The steps I used to bind each field and
control on the window to the class BMICalculate are the same ones I
used on pure Cocoa appl. Somehow, they do not work when using PyCocoa.
Thanks for any help you can provide.
-----
J.C. Cruz
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden