Re: Any one have pointers/examples on drawing within a column in a table view?
Re: Any one have pointers/examples on drawing within a column in a table view?
- Subject: Re: Any one have pointers/examples on drawing within a column in a table view?
- From: Yann Bizeul <email@hidden>
- Date: Wed, 12 Jan 2005 15:16:22 +0100
I have the need to pretty much own the drawing of a specific column. I
need to do this because I need to indicate connections between rows in
the column. I know I can subclass NSCell so that I can draw within the
cells of the column but how do I go about drawing from one cell to
another? Do I need to subclass NSTableView and override drawRect or is
there a more appropriate way to do this? Any pointers or examples are
greatly appreciated.
You need to change the cell type for that column, using setCell: method
on NSTableColumn (AFAIR).
Now I see two solutions :
The more simple would be to return an NSImage when
tableView:objectValueForTableColumn:row: is called. This is not
suitable when you need really dynamic content.
The second oslution would be to make a new NSCell subclass and give it
the behavior you want.
I think you should go through the ClockControl example you will find in
/Developer/Examples/AppKit/ClockControl/, there is a sample of a custom
NSControl in a NSTableView cell.
--
Yann Bizeul - yann at tynsoe.org
Please use this e-mail when writing to me.
You can visit my projects at this address :
http://projects.tynsoe.org/
(BuddyPop - GeekTool - SSH Tunnel Manager...)
_______________________________________________
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