NSOutlineView Row Heights

  • in 10.4, NSOutlineView has support for varying row heights.

    question is, how are row heights set? If I subclass NSCell (or
    NSTextCell) and manipulate the value returned by cellSize, is that
    all there is to it?

    I've looked at the RowResizeableOutlineView project and used some
    ideas in it to get where I am, but I'm not clear on the issue above.
    In case it's relevant, this is a Core Data Document Based project

    The second part of the question would be, what do I use to calculate
    the height required for a textcell with an arbitrary amount of text
    in it, for a given width?

    Many thanks in advance from a perma-newbie for any help...

    Dan Donaldson
    dan[at]omnivore[dot]ca
  • If you know NSOutlineView supports this, why not look in
    NSOutlineView's documentation? :-)

      What you're looking for is the delegate method: -
    outlineView:heightOfRowByItem: ... NSTableView has a similar delegate
    method.

      I hope this helps.

    --
    I.S.

    On Oct 17, 2006, at 10:59 AM, Dan Donaldson wrote:

    > in 10.4, NSOutlineView has support for varying row heights.
    >
    > question is, how are row heights set? If I subclass NSCell (or
    > NSTextCell) and manipulate the value returned by cellSize, is that
    > all there is to it?
    >
    > I've looked at the RowResizeableOutlineView project and used some
    > ideas in it to get where I am, but I'm not clear on the issue
    > above. In case it's relevant, this is a Core Data Document Based
    > project
    >
    > The second part of the question would be, what do I use to
    > calculate the height required for a textcell with an arbitrary
    > amount of text in it, for a given width?
    >
    > Many thanks in advance from a perma-newbie for any help...
    >
    > Dan Donaldson
    > dan[at]omnivore[dot]ca
    >
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
    > 40gmail.com
    >
    > This email sent to <idiotsavant2005...>
  • > The second part of the question would be, what do I use to calculate
    > the height required for a textcell with an arbitrary amount of text
    > in it, for a given width?

    NSTextFieldCell's cellSizeForBounds method will do this for you. So I guess
    in the delegate method to get the row height, you could use that method on
    the various cells for the columns? (I used the RowResizeableOutlineView
    project myself, because I needed to support 10.3.)

    --
    Scott Ribe
    <scott_ribe...>
    http://www.killerbytes.com/
    (303) 722-0567 voice
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today