Creating an inspector window

Discussion in 'Mac Programming' started by caveman_uk, Jan 30, 2006.

  1. caveman_uk Guest


    Feb 17, 2003
    Hitchin, Herts, UK
    I'm thinking of creating an inspector window in one of my apps. I'd like it to act like the inspector windows in MS Word, omnioutliner et al - i.e. to have collapsable sections. To me, this looks like it should be a custom NSOutlineView subclass with custom NSViews for the 'children'.

    Does anyone have any other ideas or know of any example source code for this?
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    I don't think you want to use NSOutlineView as your starting point. It is basically an NSTableView and as such it does not contain subviews. Each coloum/row is an NSCell. You are going to have to do a ton of work to get it to allow you to use NSViews instead.

    I would define an NSView subclass that displayed the title/show hide disclosure triangle. Give it some behaviour so as the triangle works as expected (either remove the subview or hide it depending on which OSs you want to support). The view could also automatically resize it's containing NSWindow by the correct amount.

    Then tart it up with animation of the window resize (really easy) and fading of the hiding view in out (easy on 10.4, a bit more difficult on 10.3).
  3. logicat2001 macrumors regular

    Apr 16, 2003
    Minneapolis, MN
    You might consider checking out MOKit, specifically the MOViewController and MOViewListView.

Share This Page