• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cell alignment within a NSTableColumn
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
References: 
 >Re: Cell alignment within a NSTableColumn (From: Nicholas Riley <email@hidden>)

  • Prev by Date: Re: NSMenu setMenuBarVisible
  • Next by Date: Re: NSMenu setMenuBarVisible
  • Previous by thread: Re: Cell alignment within a NSTableColumn
  • Next by thread: Re: sinf(), cosf() et al
  • Index(es):
    • Date
    • Thread