Re: Getting notified when my cell is hidden in NSOutlineView
Re: Getting notified when my cell is hidden in NSOutlineView
- Subject: Re: Getting notified when my cell is hidden in NSOutlineView
- From: Glen Simmons <email@hidden>
- Date: Wed, 18 Jun 2003 12:12:13 -0500
I'm actually already using this to setup some other cells.
Unfortunately for this particular problem, it's called when the cell is
about to be displayed, not when it's about to be hidden.
On Wednesday, June 18, 2003, at 12:01 PM, zauhar wrote:
>
Glen, another approach might be to use a delegate. The delegate method
>
>
- (void)outlineView:(NSOutlineView *)outlineView
>
willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn
>
item:(id)item
>
>
>
is called just before a cell is drawn. I don't know if that meshes
>
with the logic of your program, but this will only be called for
>
visible cells.
>
>
Randy
>
>
On Wednesday, June 18, 2003, at 12:39 PM, Glen Simmons wrote:
>
>
> Maybe so. This just seems to break the modularity of the cell object.
>
> My understanding is that a cell is supposed to be handed a value and
>
> display it when told. For it to need to know about it's parent (and
>
> the parent's parent, etc.) really seems to violate OOP principles. Oh
>
> well.
>
>
>
> Thanks,
>
> Glen
>
>
>
> On Wednesday, June 18, 2003, at 11:17 AM, zauhar wrote:
>
>
>
>> Glen, the data source for your outlineview requires a tree structure
>
>> - even if your child doesn't directly know its parents, then
>
>> somewhere you must be retaining that information. There should be a
>
>> place (in your controller?) where you can implement a method that
>
>> returns the parent of a child.
>
>>
>
>> I realize that you are trying to get the information directly from
>
>> the view, but I get the impression from the available methods that
>
>> 'isItemExpanded' is the expected route. Maybe someone else knows
>
>> another trick.
>
>>
>
>>
>
>> Randy
>
>>
>
>> On Wednesday, June 18, 2003, at 11:18 AM, Glen Simmons wrote:
>
>>
>
>>> True, but the cell typically doesn't know anything about the
>
>>> parent. I'm trying to keep it as self-contained as possible, so I'm
>
>>> hoping for a way that I can find out directly from the outline view
>
>>> that the cell is not visible.
>
>>>
>
>>> On Wednesday, June 18, 2003, at 09:54 AM, zauhar wrote:
>
>>>
>
>>>> You can use the method
>
>>>>
>
>>>> [ outlineview isItemExpanded:parent ]
>
>>>>
>
>>>> to check the state of the parent item.
>
>>>>
>
>>>> Randy
>
>>>>
>
>>>> On Wednesday, June 18, 2003, at 10:17 AM, Glen Simmons wrote:
>
>>>>
>
>>>>> Hi all,
>
>>>>>
>
>>>>> I have a subclass of NSImageCell that displays a progress
>
>>>>> indicator in addition to images. The problem I'm having is that I
>
>>>>> have no idea when the cell is hidden by the outline view, like
>
>>>>> when the parent item is collapsed. So I end up with the progress
>
>>>>> indicator spinning out in empty space. Is there any way to find
>
>>>>> out when my cell shouldn't be drawing?
>
>>>>>
>
>>>>> Thanks,
>
>>>>> Glen
>
>>>>> _______________________________________________
>
>>>>> 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.
>
>>>>>
>
>>>>>
>
>>>>
>
>>>> Randy J. Zauhar, PhD
>
>>>> Assoc. Prof. of Biochemistry
>
>>>> Director, Graduate Program in Bioinformatics
>
>>>> Dept. of Chemistry & Biochemistry
>
>>>> University of the Sciences in Philadelphia
>
>>>> 600 S. 43rd Street
>
>>>> Philadelphia, PA 19104
>
>>>>
>
>>>> Phone: (215)596-8691
>
>>>> FAX: (215)596-8543
>
>>>> E-mail: email@hidden
>
>>>> Web: http://tonga.usip.edu/zauhar
>
>>>>
>
>>>>
>
>>>> Discussion after watching Disney's "Lilo & Stitch":
>
>>>>
>
>>>> DAD: "But why did the space aliens speak English, as opposed to
>
>>>> French, or Swahili? And why did the one alien speak English with
>
>>>> an Eastern European accent? I don't get it."
>
>>>>
>
>>>> CATHERINE (age 7): "That's 'cause you don't have a good cartoon
>
>>>> brain."
>
>>>> _______________________________________________
>
>>>> 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.
>
>>>
>
>>>
>
>>
>
>> Randy J. Zauhar, PhD
>
>> Assoc. Prof. of Biochemistry
>
>> Director, Graduate Program in Bioinformatics
>
>> Dept. of Chemistry & Biochemistry
>
>> University of the Sciences in Philadelphia
>
>> 600 S. 43rd Street
>
>> Philadelphia, PA 19104
>
>>
>
>> Phone: (215)596-8691
>
>> FAX: (215)596-8543
>
>> E-mail: email@hidden
>
>> Web: http://tonga.usip.edu/zauhar
>
>>
>
>>
>
>> Discussion after watching Disney's "Lilo & Stitch":
>
>>
>
>> DAD: "But why did the space aliens speak English, as opposed to
>
>> French, or Swahili? And why did the one alien speak English with an
>
>> Eastern European accent? I don't get it."
>
>>
>
>> CATHERINE (age 7): "That's 'cause you don't have a good cartoon
>
>> brain."
>
>>
>
>>
>
>
>
>
>
>
>
>
Randy J. Zauhar, PhD
>
Assoc. Prof. of Biochemistry
>
Director, Graduate Program in Bioinformatics
>
Dept. of Chemistry & Biochemistry
>
University of the Sciences in Philadelphia
>
600 S. 43rd Street
>
Philadelphia, PA 19104
>
>
Phone: (215)596-8691
>
FAX: (215)596-8543
>
E-mail: email@hidden
>
Web: http://tonga.usip.edu/zauhar
>
>
>
Discussion after watching Disney's "Lilo & Stitch":
>
>
DAD: "But why did the space aliens speak English, as opposed to
>
French, or Swahili? And why did the one alien speak English with an
>
Eastern European accent? I don't get it."
>
>
CATHERINE (age 7): "That's 'cause you don't have a good cartoon brain."
_______________________________________________
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.