Passing events from original receiver / redirecting flow of events
Passing events from original receiver / redirecting flow of events
- Subject: Passing events from original receiver / redirecting flow of events
- From: Chilton Webb <email@hidden>
- Date: Tue, 16 Jun 2009 07:58:37 -0500
Hi,
I have one main view. I want to pop up another view in the middle of
it, like the star menu Carbon sample code. Then I want that new view
to take over all event processing. And I want to do this without
polling for mouse events from the main view, and manually sending them
to the subview.
What I would like:
Ideally, once I've alloc/init'd the view, I would like to just tell it
to start receiving all future mouse movements, as though it was
already in place and clicked on, instead of the main view.
What I have already done:
When the user clicks on a popup area, I create my popup menu, display
it as a subview of the main view, then (remember I'm still in my mouse
event in the main view) poll for all mouse events until the user is
done with the popup, and I forward them manually to the subview.
I don't think this is the best way to do this, but I can't figure out
how to redirect the flow of events to the subview *without* doing it
manually, after an initial mouse down event, but before the mouse up
event.
And ultimately, I'd like to apply the same concepts to an iPhone app,
but I'm not sure how to redirect the touchesBegan...touchesEnded
system, either.
Disclaimers:
1) I couldn't find anything helpful on Google, but probably searched
for the wrong terms.
2) I don't see any example code except the Carbon 'star popup' that
might be relevant. And I'm not sure how the star popup code maps to
Cocoa equivalents.
3) I ran a few different apps through Shark to see how they're doing
it, and they're all running polling loops for their custom popup
menus / windows, too.
4) I asked in the Apple discussion forums, but the question has gone
unanswered in the 3 days since I posted it.
Any suggestions would be welcome.
Thanks!
-Chilton Webb
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden