NSOutlineView "expandAll" function.
NSOutlineView "expandAll" function.
- Subject: NSOutlineView "expandAll" function.
- From: Roberto Esposito <email@hidden>
- Date: Mon, 10 Nov 2003 15:23:59 +0100
Hi all,
I have just implemente a method "expandAll" which expands all groups
in a NSOutlineView. I tried the method from the interface of my app
(i.e., I added a button which calls the method) and it works fine. The
problem is that now I want the method to be called right after my
document has been loaded from file (the idea is that this is a feature
that each user can set in its preferences).
I've tried to call it at the end of my loadDataRepresentation:ofType:
method, but at that moment it seems that the outline view is still not
aware of the newly loaded data and hence the "expandAll" exits
immediately (expandAll cicles on each row of the outlineView calling
"expandItem" on it, in the above situation outline views method
"numberOfRows" returns 0).
I've also tried to create a notification which I post at the end of
loadDataRepresentation:ofType: and to register "expandAll" as listener
for the notification, but still without any luck.
I thought to cicle on the "model" I use to model the outlineView
(instead of the outline view itself), but I think that the problem
would not change (I would call expandItem on an item that the outline
view does not recognize yet).
I'm not aware of any clean solution to the problem... I need something
which informs me as soon as the outline view become aware of the loaded
data, but could not find anything like this in the docs (it seems from
the docs that NSOutlineView does not post any notification whatsoever).
Perhaps I'm missing something fundamental here since the problem looks
at first very simple...
Any hint?
Thanks in advance,
Roberto
_______________________________________________
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.