Re: [Pyobjc-dev] issues with NSURL and NSWindow?
Brought to you by:
ronaldoussoren
From: James E. <ea...@ba...> - 2004-04-05 04:07:43
|
On 4 Apr 2004, at 23:37, b.bum wrote: > That should be: > > >>> from Foundation import * > >>> u = NSURL.alloc().initWithString_('http://pyobjc.sf.net') Ahhh, it's good to see that that was just a case of me being stupid (with more practice with pyobjc I expect that sort of thing will become blatantly obvious to me) ;-) >> That error occurs when I call MyAppController.window.isMainWindow() >> where MyAppController.window is an IBOutlet of type NSWindow. > > Do you mean that 'window' is an outlet of type NSWindow? > > The error message indicates that whatever is found via the '.window' > is a method, not a reference to a window object. > > So, MyAppController.window().isMainWindow() might "just work", but I'm > still confused. What is MyWindowController? The naming implies > that it is a class of some kind... Now I'm really confused. I tried your trick of invoking MyAppController.window as a method instead of a variable and that seems to have worked. MyAppController is a class that I've defined in python and is the File's Owner in the nib that constructs the particular window at issue here (I probably confused you with the code fragment above since the fragment should use an instance, not the class). That controller specifies, among others, and outlet named window, which is connected to the NSWindow instance in the nib. Which is why I would have thought that I'd use something like: myAppControllerInstance.window.isMainWindow() just like I use in other places myAppControllerInstance.textField.stringValue(). So why is window suddenly a method? (since myAppControllerInstance.window().isMainWindow() works where I would have expected an error) Thanks! James -- There is no spoo. |