• 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
Re: NSTableView selection (partial solution)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView selection (partial solution)


  • Subject: Re: NSTableView selection (partial solution)
  • From: Alexander Lamb <email@hidden>
  • Date: Wed, 31 May 2006 11:11:12 +0200

Not yet a perfect solution (graphically speaking) but this works:

I subclassed NSTableView and implemented the following method:

- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection: (BOOL)extend
{
NSLog(@"--- select Row(s): %@", indexes);
if([indexes count] == 1 && [[self selectedRowIndexes] containsIndex: [indexes firstIndex]])
[self deselectRow:[indexes firstIndex]];
else
[super selectRowIndexes:[NSIndexSet indexSetWithIndex:[indexes firstIndex]] byExtendingSelection:YES];
}


It works, however I still have two issues with this:

1) The "unhighlight" is not drawn very niceley

2) Since it is not usuall to have that kind of behavior, I would like to disable the highlighting and use checkboxes instead. Probably I will need to subclass the cells to override the highlighting?
--
Alexander Lamb
email@hidden




On May 31, 2006, at 9:52 AM, Alexander Lamb wrote:

Hello list,

With a CoreData application I would like to manage a multiple selection in a NSTableView.
It is easy, except I would like to avoid having to use "option- click" (need two hands).


So, I thought of two solutions:

1) Catch the mouse down (single click) to toggle the selected state of the row

2) Add a "selected" transcient attribute to the entity, add a checkbox column and disable the selection in the table view

The first solution seems better. Is there a way to handle this in an easy way? What should I override in a subclass (or can I avoid subclassing?)

Thanks,

Alex
--
Alexander Lamb
email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NSTableView selection (From: Alexander Lamb <email@hidden>)

  • Prev by Date: NSTableView selection
  • Next by Date: Click on a URL in WebKit
  • Previous by thread: NSTableView selection
  • Next by thread: Click on a URL in WebKit
  • Index(es):
    • Date
    • Thread