• 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
NSCell Subclass used in NSTableView, what size does the cell have ( must be availaable to the cell )
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSCell Subclass used in NSTableView, what size does the cell have ( must be availaable to the cell )


  • Subject: NSCell Subclass used in NSTableView, what size does the cell have ( must be availaable to the cell )
  • From: devmaillists <email@hidden>
  • Date: Fri, 16 Dec 2005 15:15:25 +0100

Dear List,

I use a subclassed NSTextFieldCell in a NS TableView.

in setStringValue I think I should limit the the drawing area of the NSTextStorage.
To do this I need to know the Size of my cell.
The height is not a problem because it is the same for all cells:
test.height=[((NSTableView*)[self controlView])rowHeight];
But the collumn I am in is the question.
Or ist the a single function in the NSCell Class that returns the correct frame.

Thank you very much…

- (void) setStringValue:(NSString *)Str
{
NSTextStorage*textStorage = [[NSTextStorage alloc] initWithString:Str];

NSTableColumn* anyColumn=[[[self controlView] tableColumns] objectAtIndex:0];

NSSize test;
test.height=[((NSTableView*)[self controlView])rowHeight];
test.width=[anyColumn width];

NSLayoutManager* layoutManager = [[NSLayoutManager alloc] init];
NSTextContainer* textContainer = [[NSTextContainer alloc] initWithContainerSize:test];
[layoutManager addTextContainer:textContainer];
[textContainer release];
[textStorage addLayoutManager:layoutManager];
[layoutManager release];
[super setRepresentedObject:textStorage];
}

_______________________________________________
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
  • Follow-Ups:
    • Re: NSCell Subclass used in NSTableView, what size does the cell have ( must be availaable to the cell )
      • From: Phil Frost <email@hidden>
    • Re: NSCell Subclass used in NSTableView, what size does the cell have ( must be availaable to the cell )
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Set of controls offered in IB palette
  • Next by Date: Re: Set of controls offered in IB palette
  • Previous by thread: Re: Set of controls offered in IB palette
  • Next by thread: Re: NSCell Subclass used in NSTableView, what size does the cell have ( must be availaable to the cell )
  • Index(es):
    • Date
    • Thread