Re: Cells within cells (specifically in outline views)
Re: Cells within cells (specifically in outline views)
- Subject: Re: Cells within cells (specifically in outline views)
- From: email@hidden
- Date: Thu, 12 Jan 2006 14:01:06 +0100
Hi,
Have a look at Apple sample "DragNDropOutlineView".
Disclosure triangle is native in OutlineView.
Then you just have to subclasse NSTextFieldCell (if you want an editable texte
cell) to include an image before the text.
It's a great solution. Work well for me.
Hope this help.
Guillaume
Selon Ken Tabb <email@hidden>:
> Hi folks,
>
> If I were making a custom control (eg. a new type of button) and I
> needed more than 1 thing displayed in it (eg. an image and a bit of
> text), it would not be beyond the wit of man (nor indeed my own wit)
> to use several subviews to do the leg work, perhaps an NSImageView
> and an NSTextField.
>
> However if I have an outline view and want such a layout (image over
> here in the cell, editable text over here, and of course the
> disclosure triangle (in cells that represent non-leaf objects)), how
> do I go about it? As cells aren't views, you can't just add subviews
> (or indeed other cells?) to the cell. Equally I can't just make a new
> view that contains the necessary subviews, and tell the outline view
> to use that, as it wouldn't be doing the multiple-row outline view
> stuff (including collapsing / expanding items that are clicked and
> generating / removing rows accordingly).
>
> There must be an obvious answer to this but I'm (expletive removed)
> if I can think of it!
>
> Naturally the way involving the least re-implementation of things
> would be preferable - I did think of doing my own cell that just
> reinvented both wheels (image and text) within the same cell, but
> that would also need me to pretty much re-implement some of
> NSTextFieldCell I guess, so that the focus ring just gets drawn
> around the text area and not the whole cell etc.
>
> I guess I'm after making a similar thing to the cell used in the
> 'name' column of the Finder's list view, if that helps re-phrase my
> dilemma!
>
> Cheers in advance,
> Ken
>
> - - - - - - - - - -
> Dr. Ken Tabb
> Mac & UNIX Developer - Health & Human Sciences
> Machine Vision & Neural Network researcher - School of Computer Science
> University of Hertfordshire, UK
> http://www.health.herts.ac.uk/ken/
>
> Certified non-Microsoft Solution Provider
>
> _______________________________________________
> 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
>
_______________________________________________
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