On May 21, 2013, at 9:52 AM, Steve Mills <smi...@makemusic.com> wrote:

> On May 21, 2013, at 10:11:45, Kyle Sluder <k...@ksluder.com> wrote:
> 
>> You could try it, but +runModalForWindow might not invoke -sendEvent: to 
>> dispatch the events it pulls off the event queue within its nested runloop 
>> invocation.
> 
> I meant using sendEvent for handling all the events for this popup window 
> *instead of* using runModalForWindow, since that won't work for clicks out 
> side the window to dismiss it.

One concern is that you're not going to get a mouse event for clicks that 
happen in other apps' windows, but that might actually be what you want.

An alternative approach would be to put up a transparent shielding window 
underneath your browser, and have any clicks on it dismiss the browser.

> 
>> Let's back up to your original question. Why do you need to run a runloop at 
>> all? NSPopupButtonCell will do that for you, and it will correctly handle 
>> the case where the user clicks outside the menu to dismiss.
>> 
>> Look up -performClickWithFrame:inView:.
> 
> I'm not sure how performClickWithFrame helps here. It's documentation says it 
> displays the menu. That's not what I've been asking about. In our 
> NSPopUpButtonCell subclass's trackMouse method, we create a window to display 
> instead of showing the menu. This window has a 3-column NSBrowser in it for 
> displaying a tree type structure. Clicks in column 1 will change what's shown 
> in columns 2 and 3. Clicks in column 2 will change what's shown in column 3. 
> Column 3 is the place where choices are ultimately made. Each column is 
> individually scrollable. So, this control deviates from normal popup usage in 
> that you can't mouseDown/drag/mouseUp to make a choice. A mouseDown/mouseUp 
> shows it, multiple mouseDown/mouseUps can be made until a final 
> mouseDown/mouseUp is made in the 3rd column, or the arrow and return keys can 
> be used to navigate and make a final choice.

Oh, I misunderstood you to mean the popup button cell was located on a 
modally-running browser window, not that it _spawned_ the window.

--Kyle Sluder
_______________________________________________

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

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

Reply via email to