Re: Selecting rows in NSOutlineView from menuForEvent:?
Re: Selecting rows in NSOutlineView from menuForEvent:?
- Subject: Re: Selecting rows in NSOutlineView from menuForEvent:?
- From: Corbin Dunn <email@hidden>
- Date: Mon, 17 May 2010 14:33:26 -0700
On May 15, 2010, at 12:31 AM, Ryan C. Payne wrote:
> On Apr 9, 2010, at 15:17, Nick Zitzmann wrote:
>
>>
>> On Apr 9, 2010, at 3:42 PM, Laurent Daudelin wrote:
>>
>>> However, the selection is the standard highlight, not the outline I see in any other table views in other Apple applications.
>>
>> I think the "drop highlighting" thing a few Apple apps do is accomplished through a private API.
It is not private, and the DragNDropOutlineView demo app shows how to do it. Please look at that and the release notes. If you then have questions, please post them. We can fix the demo, and address problems with documentation enhancements (or code changes, if necessary).
corbin
>> I wouldn't worry about it too much, since you'd be amazed at how many people don't even know that contextual menus exist (unless your target market is exclusively power users), but you can probably do this yourself by overriding the row drawing method to draw a similar-looking bezier path over the top of the row.
>
>
> I was looking into this myself, as I like the little ovally highlight that you get in 10.6 when you right click on items in a table view other than the currently selected item. I have the need to be able to return different menus based on the item that I am right clicking on and to accomplish that I had overridden menuForEvent. I was disappointed that I didn't get that fancy 10.6 highlight when doing so. However, I have found that if you call [super menuForEvent:event] in your overridden method, you will still get the ovally highlight.
>
> One point to note, however, is that doing that on 10.5 and *not* selecting the row causes you to get a box highlight on the row, with an empty background. So in the end I am doing a check to see if I am running on 10.5. If I am, I just change the row selection to the row where the event was fired and then do my menu determination. If it's not 10.5, I call the [super menuForEvent:event] call and go on my merry way.
_______________________________________________
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