Drawing Across NSTableView Columns
Drawing Across NSTableView Columns
- Subject: Drawing Across NSTableView Columns
- From: "K. Darcy Otto" <email@hidden>
- Date: Sun, 26 Apr 2009 15:29:17 -0700
I'm attempting to model a real-world table structure with an
NSTableView. Here is what the table structure might look like on
paper (warning: ASCII art ahead):
1. | A
2. || B
3. ||| C
4. |||| D
5. |||| E
6. |||| F
Between the number and the letters are a series of (unbroken) vertical
lines, running from the row where they were first drawn, to a row
where it ends. Where each line begins and ends depends on various
things going on in the table. Also, each additional line creates an
indent in the letters column. The problem is, how do I model this in
an NSTableView? I have considered:
(a) Just using a series of pipes (|), to which the letter is appended
as the return value for -tableView:objectValueForTableColumn:row:
(int)row. This could work, except that as long as the pipes are not
vertically connected, it looks very ugly.
(b) Creating an image of the lines that is then somehow overlaid on
the table to give the right effect.
(c) I read about setting the background colour of a table to a
pattern, which might be based on an image here: http://www.cocoabuilder.com/archive/message/cocoa/2004/6/21/110256
I'm not sure whether this would work.
(d) I read about drawing within a custom NSTextField Cell here: http://www.cocoabuilder.com/archive/message/cocoa/2004/3/1/100423
I think this might still make the image break at each row.
Regarding (a), I was thinking maybe playing with the line thickness
between rows, and then making a pipe (|) that is too big to fit within
the cell might work; but I'm not really sure.
Any ideas how I should go about this? Thanks.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden