Re: Help with NSOutlineView selection
Re: Help with NSOutlineView selection
- Subject: Re: Help with NSOutlineView selection
- From: Scott Mitchell <email@hidden>
- Date: Thu, 13 Apr 2006 11:36:22 -0600
On Apr 13, 2006, at 10:38 AM, Ondra Cada wrote:
Scott,
On 13.4.2006, at 17:54, Scott Mitchell wrote:
I have been trying to figure out how to get the row selection in
an NSOutlineView? I can't use selectedRow to get this because it
returns the index of the selected row. But that won't work for a
NSOUtlienView, will it? What I need to be able to do of course is
get what item is selected so I know what info the user chose, and
also need to enable/disable a button depending on the data the
user chose. Can anyone help me, I have been searching the list and
looking at the doc's but can't seem to find it.
If you use your own data source, just translate rows for items
(which you are bound to know) by itemAtRow:.
Ok, but again how do I know what row is selected? By using
selectedRow? If so that does not make sense, as your index will
change depending on if you open an outline above it. So it could be
the say 7th item in the NSOutlineView, but if you expand an item
above it it would move down. Maybe I am not understanding something
about this. Sorry, being a little slow today.
If you bind through an NSTreeController, use its methods (namely,
selectedObjects in code, selection for bindings).
Unfortuantly I can not use NSTreeController because I have to support
back to 10.2 (this is for the education sector)
Thanks,
Scott Mitchell
Senior Macintosh Software Engineer
Excelsior Software
http://www.excelsiorsoftware.com
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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