RE: NSApplicationMain() doesn't set NSApp to my subclass
RE: NSApplicationMain() doesn't set NSApp to my subclass
- Subject: RE: NSApplicationMain() doesn't set NSApp to my subclass
- From: "Christopher Hickman" <email@hidden>
- Date: Wed, 17 Aug 2005 16:29:40 -0400
Okay, it turns out that it is correctly setting NSApp to an instance of my
subclass. I only thought it wasn't because the backtrace was showing
-[NSApplication run] and not -[SWLApplication run]. I guess that's because
I didn't need to override the super's implementation of run. The other
reason I thought it wasn't working was that the point of me subclassing
NSApplication was to take the NSScrollWheel events and pass them off to
another object, so that scroll wheel events would be application-global. It
isn't working. Even though my NSApp object implements scrollWheel:, it is
never called when the scroll wheel scrolls.
Am I going about this wrong? Here's what I want to happen.
When my app is active, and the scroll wheel is moved (regardless of the
mouse location), I want to take that event and route it to a slider in my
interface. What I have done now (which doesn't work, remember) is subclass
NSApplication and implement scrollWheel: such that it just takes theEvent
and calls [mySlider scrollWheel:theEvent]. It is *never* called. Perhaps
this is a bug and this is the same reason that the on scroll wheel handler
is never called when it is connected to the application object in
AppleScript Studio (the situation I'm trying to workaround with ObjC).
Again, any hints are appreciated.
Thanks,
Topher
-----Original Message-----
From: cocoa-dev-bounces+tophu=email@hidden
[mailto:cocoa-dev-bounces+tophu=email@hidden] On Behalf Of
Christopher Hickman
Sent: Wednesday, August 17, 2005 4:03 PM
To: email@hidden
Subject: NSApplicationMain() doesn't set NSApp to my subclass
I have an app with a subclass of NSApplication, called SWLApplication. I've
set the custom class of File's Owner in MainMenu.nib to my subclass and I've
changed my principal class to SWLApplication in my application's target in
Xcode, but when I run my app NSApplicationMain() doesn't initialize the
NSApp global with an instance of my subclass. Instead, NSApp is an
NSApplication instance.
Am I missing a step somewhere?
Any hints are appreciated.
Thanks,
Topher
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden