Re: Cell alignment within a NSTableColumn
Re: Cell alignment within a NSTableColumn
- Subject: Re: Cell alignment within a NSTableColumn
- From: email@hidden
- Date: Tue, 22 Oct 2002 23:25:36 +0200
On mardi, octobre 22, 2002, at 11:07 PM, Nicholas Riley wrote:
On Tue, Oct 22, 2002 at 12:54:37PM +0200, Stiphane Sudre wrote:
How do you get the data cell alignment within a NSTableColumn?
I'm pretty sure the answer is obvious but I don't find it. [NSCell
alignment] is always returning me 0 (Left Alignment).
I have a custom NSCell as the dataCell for the NSTableColumn. I tried
both with subclassing NSCell and NSActionCell. Same results.
The more important question is "how, and when, do you set the data
cell alignment?" Are you doing it from IB, or from code?
Your problem here, most likely, is that you're setting the alignment
in the NSTableColumn inspector in Interface Builder, and are creating
your cell programmatically after Interface Builder has set the
alignment for you. It seems the intended pattern is that you hook up
the dataCell outlet of the NSTableColumn in IB to an instance of your
cell subclass. But, at least in IB 2.2.1 you can't instantiate NSCell
subclasses in IB directly.
[...]
You're perfectly right. That's the explanation I finally also found
when I was thinking about this problem in the bus (the one on wheels,
not the one in the Mac).
Strangely, I was thinking that doing a setDataCell would keep the
alignment as it's displayed in IB as a property of the NSTableColumn.
Stupid me.
_______________________________________________
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.