NSOutlineView Items Like iTunes 7.4

  • I  am using NSOutlineView in an application and will like to have some
    of the items behave like they do iTunes:

    LIBRARY and STORE have the these desirable attributes:

    a.  they do not have the disclosure button
    b.  their children are already expanded when iTunes is started.

    I've searched past postings on the cocoa-dev list but cannot find any
    help in this regard.  Can anyone help please?

    Thanks in advance
  • you wont get that by default but you could start with this
    http://elfurl.com/chnn6+Clint

    On 9/18/07, Michael Larbi <michael.larbi...> wrote:
    >
    > I  am using NSOutlineView in an application and will like to have some
    > of the items behave like they do iTunes:
    >
    > LIBRARY and STORE have the these desirable attributes:
    >
    > a.  they do not have the disclosure button
    > b.  their children are already expanded when iTunes is started.
    >
    > I've searched past postings on the cocoa-dev list but cannot find any
    > help in this regard.  Can anyone help please?
    >
    > Thanks in advance
    >
  • Hi Clint,

    Thanks for the response.  I found a rather elegant solution with
    Leopard version of NSOutlineView.  The following has been added in
    NSOutlineView.h

    #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5

    /* Returns the frame of the outline cell for a particular row,
    considering the current indentation and indentationMarkerFollowsCell
    value. If 'row' is not an expandable row, it will return NSZeroRect.
    This method can be overridden by subclassers to return a custom frame
    for the outline button cell. If an empty rect is returned, no outline
    cell will be drawn for that row.
    */
    - (NSRect)frameOfOutlineCellAtRow:(NSInteger)row;

    #endif

    So by overriding this method in my subclass of NSOutlineView I was
    able to return NSZeroRect for rows where I don't want the disclosure
    triangle.  That worked fine.

    Thanks again

    Michael

    On 19 Sep 2007, at 12:55, Clint Shryock wrote:

    > you wont get that by default but you could start with this
    > http://elfurl.com/chnn6
    >
    > +Clint
    >
    > On 9/18/07, Michael Larbi <michael.larbi...> wrote:
    > I  am using NSOutlineView in an application and will like to have some
    > of the items behave like they do iTunes:
    >
    > LIBRARY and STORE have the these desirable attributes:
    >
    > a.  they do not have the disclosure button
    > b.  their children are already expanded when iTunes is started.
    >
    > I've searched past postings on the cocoa-dev list but cannot find any
    > help in this regard.  Can anyone help please?
    >
    > Thanks in advance
    >
  • On 19/09/2007, Michael Larbi <michael.larbi...> wrote:
    >
    > Hi Clint,
    >
    > Thanks for the response.  I found a rather elegant solution with
    > Leopard version of NSOutlineView.  The following has been added in
    > NSOutlineView.h
    >
    > #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
    >
    > /* Returns the frame of the outline cell for a particular row,
    > considering the current indentation and indentationMarkerFollowsCell
    > value. If 'row' is not an expandable row, it will return NSZeroRect.
    > This method can be overridden by subclassers to return a custom frame
    > for the outline button cell. If an empty rect is returned, no outline
    > cell will be drawn for that row.
    > */
    > - (NSRect)frameOfOutlineCellAtRow:(NSInteger)row;
    >
    > #endif
    >
    > So by overriding this method in my subclass of NSOutlineView I was
    > able to return NSZeroRect for rows where I don't want the disclosure
    > triangle.  That worked fine.

    Sounds pretty hacky... Is -(int)levelForItem:(id)item not the thing you
    actually want?..

    --
    Igor M.
  • > Thanks for the response.  I found a rather elegant solution with
    > Leopard version of NSOutlineView.  The following has been added in
    > NSOutlineView.h

      Is the concept of a non-disclosure agreement really so hard for so
    many people to understand? It's a legally-binding agreement between
    you and Apple and the notice is posted all over the release notes, the
    download page, etc., so it's rather difficult to believe you didn't
    know better.

    --
    I.S.
  • Actually, I posted this before realizing what I had done.  I have no
    intention of violating non-disclosure agreements.  I was so excited to
    have found a solution that I didn't think enough about what I was
    doing by making the posting.

    On 19 Sep 2007, at 15:29, I. Savant wrote:

    >> Thanks for the response.  I found a rather elegant solution with
    >> Leopard version of NSOutlineView.  The following has been added in
    >> NSOutlineView.h
    >
    > Is the concept of a non-disclosure agreement really so hard for so
    > many people to understand? It's a legally-binding agreement between
    > you and Apple and the notice is posted all over the release notes, the
    > download page, etc., so it's rather difficult to believe you didn't
    > know better.
    >
    > --
    > I.S.
    >
  • On 9/19/07, Michael Larbi <michael.larbi...> wrote:
    > Actually, I posted this before realizing what I had done.  I have no
    > intention of violating non-disclosure agreements.  I was so excited to
    > have found a solution that I didn't think enough about what I was
    > doing by making the posting.

      Mostly understandable ... but try telling that to a raving team of
    lawyers should they decide to make an example of you. ;-)

      On the lighter side, there are a lot of really nice additions to
    Leopard that make it far more interesting to developers than to end
    users. THAT I can say without violating anything ...

    --
    I.S.
  • These might help:

    http://www.latenightsw.com/blog/?p=45
    http://web.mac.com/leemorgan/Bit_Bucket/Source_Code.html

    Dave

    On Sep 18, 2007, at 10:52 AM, Michael Larbi <michael.larbi...>
    wrote:

    > I  am using NSOutlineView in an application and will like to have some
    > of the items behave like they do iTunes:
    >
    > LIBRARY and STORE have the these desirable attributes:
    >
    > a.  they do not have the disclosure button
    > b.  their children are already expanded when iTunes is started.
    >
    > I've searched past postings on the cocoa-dev list but cannot find any
    > help in this regard.  Can anyone help please?
    >
    > Thanks in advance
previous month september 2007 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
Go to today