Re: Programmatically selecting a cell in a NSBrowser
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