• 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: Programmatically selecting a cell in a NSBrowser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatically selecting a cell in a NSBrowser


  • Subject: Re: Programmatically selecting a cell in a NSBrowser
  • From: Andy Lee <email@hidden>
  • Date: Sat, 15 Oct 2005 09:03:35 -0400

On Oct 15, 2005, at 7:28 AM, Romain Champourlier wrote:
when the user click on a non-leaf cell, I would like the browser to automatically select a given row in the coming column. This row would be programmatically determined depending on the context. My problem is that I currently found no way to perform this selection...

I would rethink the need to do this. It deviates from the standard behavior of NSBrowsers.


Assuming you definitely do want to do it... offhand, I would add logic to the browser's action method rather than in - browser:selectRow:inColumn:. Something like the following:

- (IBAction)myBrowserAction:(id)sender
{
// Skip this part if there is a multiple selection (if your browser, doesn't
// allow multiple selections, this is not an issue).
if (![[sender selectedCell] isLeaf])
{
// Otherwise, do either [sender setPath:] or [sender selectRow:inColumn:].
}


    // Continue responding to the user action.
}

--Andy

_______________________________________________
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


  • Follow-Ups:
    • Re: Programmatically selecting a cell in a NSBrowser
      • From: Andy Lee <email@hidden>
References: 
 >Programmatically selecting a cell in a NSBrowser (From: Romain Champourlier <email@hidden>)

  • Prev by Date: NSBezierPath clockwise?
  • Next by Date: Re: Programmatically selecting a cell in a NSBrowser
  • Previous by thread: Programmatically selecting a cell in a NSBrowser
  • Next by thread: Re: Programmatically selecting a cell in a NSBrowser
  • Index(es):
    • Date
    • Thread