Re: NSStatusItem with no menu triggers menu tracking
Re: NSStatusItem with no menu triggers menu tracking
- Subject: Re: NSStatusItem with no menu triggers menu tracking
- From: Kyle Moffett <email@hidden>
- Date: Fri, 19 Jul 2002 00:50:36 -0400
On Friday, July 19, 2002, at 12:30 AM, Philip George wrote:
Ok, how about we look at this from a different angle...
Instead of worrying about catching a notification or an event and then
counteracting it, what if we try to stop the click from ever reaching
the menubar? Can't I specify somehow that events STOP at a certain view
and go no further? In fact, let's pretend that I have a normal
NSWindow, which holds a view, which holds another view. The
cross-section might look like:
___________ :: viewB
_____________ :: veiwA
_________________ :: window
If I click inside viewB, how can I stop that event from making it past
viewA?
Keep in mind that the view that is inside my NSStatusItem is a custom
subclass of NSImageView and already implements the mouseDown: method...
- (void)mouseDown:(NSEvent *)theEvent {
// one would think that event processing would stop right here
since I don't
// pass the event to anyone else, but obviously the event is making
it all the
// way through my statusitem and hitting the menubar underneath.
}
What other tactic should I be using to stop the event from making it all
the way through my pile of views and hitting the menubar?
- Philip
Look at the Event Handling Task in the Cocoa Dev Docs. Apparently it
goes
the other way around, the view clicked on gets it first, then passes it
to it's super
view if desired. To do what you described above with viewB and viewA,
you
would need to subclass viewB to just pass the NSEvent on.
Grr, this is getting complicated,
Kyle Moffett
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.