Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding HUD context pannel to rows within NSOutlineView




On Nov 28, 2007, at 9:10 AM, Tim Perrett wrote:

Hey Corbin

Thanks for the reply. Ive been looking at the DragNDropOutlineView example, and I found this comment

"On MacOS 10.5 and later, in willDisplayCell: we can dynamically set the contextual menu (right click menu) for a particular cell. If nothing is set, then the contextual menu for the NSOutlineView itself will be used. We will set a different menu for the "Expandable?" column, and leave the default one for everything else."

Which Im guessing is what you meant about making it easier in 10.5? Isn't that using NSMenu however? rather than a panel which I belie those little HUD windows are?

Tim -- you are right. I am talking about NSMenu, but your original email seems to indicate that is what you wanted:


What I would like to end up with is on my outline view (that already works no problems), when the user right-clicks one of the rows, I would like that one to become the selected row, and a context menu to popup beside, from which I can set some parameters. I have read about the menu outlet, but im not sure if thats the right way to go, and even if it is, what it needs to be connected to?

A context menu is a regular menu; not a HUD. I would discourage you from creating UI that does something other than pop up a context menu on the right click; it won't be what people expect, and isn't easily discoverable. Apps that use HUD's typically bring them up in some other way. For instance, they have a button in the cell to bring it up, a toolbar item (Aperture), or an item in the context menu itself (iCal).


If you really want to do a HUD, you will probably have to subclass NSTableView, override mouseDown:, call super (to do all the work of tracking and changing the selection), and then show your HUD if it was a right click.

--corbin
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Adding HUD context pannel to rows within NSOutlineView (From: Tim Perrett <email@hidden>)
 >Re: Adding HUD context pannel to rows within NSOutlineView (From: Corbin Dunn <email@hidden>)
 >Re: Adding HUD context pannel to rows within NSOutlineView (From: Tim Perrett <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.