• 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: NSOutlineView variable width cell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView variable width cell


  • Subject: Re: NSOutlineView variable width cell
  • From: Ashley Clark <email@hidden>
  • Date: Thu, 14 Sep 2006 15:05:13 -0500

On Sep 14, 2006, at 1:36 PM, John Terranova wrote:

I do some kind of funky stuff with my table. I subclass NSTableView and override frameOfCellAtColumn:row:. This might give you some ideas of where to look in documentation as you figure out how and why this code works. In particular, look at the first case (colID == 0): this allows the text in that cell to spill past the column boundary, all the way to the right edge of the table.

That's what I'm looking for. I made a subclass of NSOutlineView and overrode frameOfCellAtColumn:row: in a similar manner to yours


- (NSRect)frameOfCellAtColumn:(NSInteger)columnIndex row:(NSInteger) rowIndex
{
NSRect cellFrame = [super frameOfCellAtColumn:columnIndex row:rowIndex];


if ([self isGroupRow:rowIndex]) {
if ([[self tableColumns] objectAtIndex:columnIndex] != [self outlineTableColumn])
return NSZeroRect;


cellFrame.size.width = [self bounds].size.width - cellFrame.origin.x;
}


    return cellFrame;
}

And it mostly works. Except when I resize a column such that the bounds overflow their normal area. In that case the cells for the row don't get redrawn correctly until I reselect the row.

This image shows what's happening after resizing the column but before reselecting the row.

http://homepage.mac.com/aclark78/Picture 1.png

Ashley Clark


_______________________________________________ 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: NSOutlineView variable width cell
      • From: John Terranova <email@hidden>
    • Re: NSOutlineView variable width cell
      • From: "I. Savant" <email@hidden>
References: 
 >NSOutlineView variable width cell (From: Ashley Clark <email@hidden>)
 >Re: NSOutlineView variable width cell (From: John Terranova <email@hidden>)

  • Prev by Date: Indexed Accessors not being called...
  • Next by Date: Re: Indexed Accessors not being called...
  • Previous by thread: Re: NSOutlineView variable width cell
  • Next by thread: Re: NSOutlineView variable width cell
  • Index(es):
    • Date
    • Thread