• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Preventing deselection of NSOutlineView item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preventing deselection of NSOutlineView item


  • Subject: Preventing deselection of NSOutlineView item
  • From: Markus Spoettl <email@hidden>
  • Date: Thu, 7 Aug 2008 14:34:27 -0700

Hi List,

I have an app with a bound NSOutlineView (source list style) and I'm wondering if there's a way to prevent deselection of a selection by the user. The delegate method

- (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem: (id)item;

is not called when no new item is selected (for example if the user clicks in the empty space of the outline view, or when COMMAND-clicks the selected item).

Basically I'd like the outline view only to change selection to other items, but not completely deselect all items. Is there a way to do this?

The closest thing I came up with is re-setting the selection indexes of the tree controller to the last known selected item (via - performSelector:withObject:afterDelay:0.0). However, that produces a flicker effect because the selection goes away briefly before it comes back. Resetting the selection index from within a change notification (via observing -selectedObjects of the tree controller) has no effect.

Regards
Markus
--
__________________________________________
Markus Spoettl

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Preventing deselection of NSOutlineView item
      • From: Markus Spoettl <email@hidden>
  • Prev by Date: Re: packed NSTextfield and NSFormatter in IB3 plugin...
  • Next by Date: NSTypesetter setLineFragmentRect:
  • Previous by thread: Re: locale of embedded frameworks
  • Next by thread: Re: Preventing deselection of NSOutlineView item
  • Index(es):
    • Date
    • Thread