Regarding iTunes 7 sidebar

  • I was wondering how I could make something that looks and works like
    the new sidebar in iTunes 7. Something like NSOutlineView, I guess.
    Any ideas? Thanks in advance!

    Fredrik Larsen.
  • Fredrik H. Larsen skrev:
    > I was wondering how I could make something that looks and works like
    > the new sidebar in iTunes 7. Something like NSOutlineView, I guess.
    > Any ideas? Thanks in advance!
    >
    Perhaps allot :).

    First you have a larger gap before each "label row" except the first
    one. So either the "label rows" needs to be of different height, or you
    need some "separator rows", I would suggest separator rows. Either way
    you need to use the NSOutlineView's delegate method
    outlineView:heightOfRowByItem: to set different heights.
    And when you are fiddling with the delegate also implement
    outlineView:shouldSelectItem: to disallow selection of the "label rows".

    Now the looks of the row cells are quite unusual so you will need to
    subclass NSTextFieldCell. I would suggest two different subclasses, one
    for the "label rows", and one for the "normal rows".
    The "label row" subclass is quite simple, override
    drawInteriorWithFrame:inView: and force uppercase, draw string twice to
    get the nice emboss look.
    For the "normal rows" check out
    Examples/AppKit/DragNDropOutlineView/ImageAndTextCell.{h|m}, to get the
    drawing with icons, do not forget to draw white text if the row is selected.
    Now you also need to subclass NSOutlineView, and override its
    highlightSelectionInClipRect: method in order to draw the selection bar,
    use an image for starters.

    If you now have two different subclasses for drawing "label rows" and
    "normal rows" then you need to also subclass NSTableColumn and override
    dataCellForRow: to return the data cell to use for each row.

    That should be about it :).

    // Fredrik Olsson

    > Fredrik Larsen.
    >
    >
    >
    >
    > _______________________________________________
    > 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/<fredrik.olsson...>.
    se

    >
    >
    > This email sent to <fredrik.olsson...>
    outlineView:heightOfRowByItem:
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