Re: NSOutlineView and expanded items
Re: NSOutlineView and expanded items
- Subject: Re: NSOutlineView and expanded items
- From: Dix Lorenz <email@hidden>
- Date: Fri, 28 Feb 2003 14:26:01 +0100
But I never "add" an item to the OutlineView. I just send a message
reloadItem:reloadChildren: for the item where I added items in the
model. At some point the OutlineView asks my datasource for the new
items, but I have no chance telling it that it should be expanded. I
could call expandItem (or expandItem: expandChildren:) after the
reloadItem:reloadChildren:, but I don't want the Outlineview to show
the new items to the User and only then expanding them. That would be
ugly. Also I think right after reloadItem the OutlineView has no
concept of the new items, so what should it do with a message to expand
it?
I haven't tested it, it could also be that displaying only happens
after the calls to expandItem. But if I understood the whole concept
correctly, I tell the OutlineView to reload some items, which it will
do when necessary. When it wants to display itself, it will ask for the
information, but then it would be too late for calls to expandItem.
Thanks,
Dix
You need to use the NSOutlineView method expandItem:
To initially expand all items, just iterate through every item and call
expandItem: on each one.
In the code you use to add a new item just call expandItem: on the item
after you add it.
Date: Thu, 27 Feb 2003 18:05:54 +0100
Subject: NSOutlineView and expanded items
From: Dix Lorenz <email@hidden>
To: email@hidden
Hi,
I have a problem using an NSOutlineView: I'd like some (actually all)
items to be initially expanded. Also while running the program I am
adding new items which also should be expanded. I haven't found
anything in the datasource or the delegate to do this...
Thanks,
Dix
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.