On 16/06/2009, at 10:58 PM, Chilton Webb wrote:

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.


After popping up the second view (from within your first view's mouseDown: I take it), call some method of your own choice on the second view. In this method, implement a loop which fetches and handles events. Do not return from this method until you get the events that dismiss it. If that is a mouse up, the first view will never get it, and the mouseDown: just returns, having handled the whole thing.

It's almost the same as what you have, except that the event processing loop has moved to the second view object.

--Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to