How to implement an "Accordion" view?

  • I'm in need of a view that acts just like the "accordion" view in CSSEdit.
    Here's an example--the accordion is on the right hand side:
    http://macrabbit.com/cssedit/screenshots/VisualEditing.jpg
    It looks like there are a few view overlapping all inside of a NSScrollView
    (scroll bars appear when the accordion is expanded pass the height of the
    window.) Is there some direction you could point me to get started on
    building something like this? Is there an open source project that has
    something similar I could take a look at?

    Thanks in advance!
  • Omni has a framework that does this for Inspector windows. I imagine
    it wouldn't be too hard to apply to being a view rather than
    standalone window:

    http://www.omnigroup.com/ftp/pub/software/Source/

    Mike.

    On 17 Dec 2007, at 19:06, Nat Edar wrote:

    > I'm in need of a view that acts just like the "accordion" view in
    > CSSEdit.
    > Here's an example--the accordion is on the right hand side:
    > http://macrabbit.com/cssedit/screenshots/VisualEditing.jpg
    > It looks like there are a few view overlapping all inside of a
    > NSScrollView
    > (scroll bars appear when the accordion is expanded pass the height
    > of the
    > window.) Is there some direction you could point me to get started on
    > building something like this? Is there an open source project that has
    > something similar I could take a look at?
    >
    > Thanks in advance!
  • Hmm, I can't get that to compile--I'll try to figure it out. But, after
    looking at OmniGraffle's inspector windows, that really isn't what I'm
    looking for. The CSSEdit ones slide out and look to act similar to a tabbed
    view (only an accordion)--not modular windows, but related panes (for
    instance, one pane will close while another opens.)
    Thanks for the link though.

    On Dec 17, 2007 11:41 AM, Mike Abdullah <cocoadev...> wrote:

    > Omni has a framework that does this for Inspector windows. I imagine
    > it wouldn't be too hard to apply to being a view rather than
    > standalone window:
    >
    > http://www.omnigroup.com/ftp/pub/software/Source/
    >
    > Mike.
    >
    > On 17 Dec 2007, at 19:06, Nat Edar wrote:
    >
    >> I'm in need of a view that acts just like the "accordion" view in
    >> CSSEdit.
    >> Here's an example--the accordion is on the right hand side:
    >> http://macrabbit.com/cssedit/screenshots/VisualEditing.jpg
    >> It looks like there are a few view overlapping all inside of a
    >> NSScrollView
    >> (scroll bars appear when the accordion is expanded pass the height
    >> of the
    >> window.) Is there some direction you could point me to get started on
    >> building something like this? Is there an open source project that has
    >> something similar I could take a look at?
    >>
    >> Thanks in advance!
    >
    >
  • Typically I think this is referred to as a 'collapsing' view rather
    than an accordion one.

    there is example code from Apple on how to do this. check the sample
    code at developer.apple.com

    On Dec 17, 2007, at 2:06 PM, Nat Edar wrote:

    > I'm in need of a view that acts just like the "accordion" view in
    > CSSEdit.
    > Here's an example--the accordion is on the right hand side:
    > http://macrabbit.com/cssedit/screenshots/VisualEditing.jpg
    > It looks like there are a few view overlapping all inside of a
    > NSScrollView
    > (scroll bars appear when the accordion is expanded pass the height
    > of the
    > window.) Is there some direction you could point me to get started on
    > building something like this? Is there an open source project that has
    > something similar I could take a look at?
  • The MOKit contains a view that works pretty well for this too.

    On 17 déc. 07, at 22:49, Nat Edar wrote:

    > Hmm, I can't get that to compile--I'll try to figure it out. But, after
    > looking at OmniGraffle's inspector windows, that really isn't what I'm
    > looking for. The CSSEdit ones slide out and look to act similar to a
    > tabbed
    > view (only an accordion)--not modular windows, but related panes (for
    > instance, one pane will close while another opens.)
    > Thanks for the link though.
    >
    > On Dec 17, 2007 11:41 AM, Mike Abdullah <cocoadev...>
    > wrote:
    >
    >> Omni has a framework that does this for Inspector windows. I imagine
    >> it wouldn't be too hard to apply to being a view rather than
    >> standalone window:
    >>
    >> http://www.omnigroup.com/ftp/pub/software/Source/
  • I checked out MOKit and it looks like the MOViewListView is the
    "accordion" I'm looking for. Thanks!

    Nat.

    On Dec 18, 2007, at 3:42 AM, Stephane Sudre <ssudre...> wrote:

    > The MOKit contains a view that works pretty well for this too.
    >
    > On 17 déc. 07, at 22:49, Nat Edar wrote:
    >
    >> Hmm, I can't get that to compile--I'll try to figure it out. But,
    >> after
    >> looking at OmniGraffle's inspector windows, that really isn't what
    >> I'm
    >> looking for. The CSSEdit ones slide out and look to act similar to
    >> a tabbed
    >> view (only an accordion)--not modular windows, but related panes (for
    >> instance, one pane will close while another opens.)
    >> Thanks for the link though.
    >>
    >> On Dec 17, 2007 11:41 AM, Mike Abdullah <cocoadev...>
    >> wrote:
    >>
    >>> Omni has a framework that does this for Inspector windows. I imagine
    >>> it wouldn't be too hard to apply to being a view rather than
    >>> standalone window:
    >>>
    >>> http://www.omnigroup.com/ftp/pub/software/Source/
    >
    >
  • I just posted the code and some screen shots of mine at
    <www.ed4u.com/DisclosureCode>.  This is for a panel window and it is the one
    where I am still having a problem with redraw flash, but other than that it
    works.  It uses generic views for the disclosure panes.  All the code is in
    a controller which I use in two of my nibs (Inspector window and A/V
    window).  Pay attention to the comments.  I did flag the disclosures buttons
    with a tag so I could find them to determine their state.  The panes do have
    to be set to the correct width and horizontal position in the nib.
    Vertically, they only have to be in the correct order -- the code will space
    them properly.  I had to sort the panes by original vertical position --
    otherwise they would stack in the order created rather than the order I
    wanted.

    Instead of a panel window, you could probably do the same thing in a view
    within a scrollerView.

    > Message: 9
    > Date: Mon, 17 Dec 2007 11:06:25 -0800
    > From: "Nat Edar" <natedar...>
    > Subject: How to implement an "Accordion" view?
    > To: <cocoa-dev...>
    > Message-ID:
    > <11bba2620712171106u4a208ed1k8d2f68cbb7b1d78c...>
    > Content-Type: text/plain; charset=ISO-8859-1
    >
    > I'm in need of a view that acts just like the "accordion" view in CSSEdit.
    > Here's an example--the accordion is on the right hand side:
    > http://macrabbit.com/cssedit/screenshots/VisualEditing.jpg
    > It looks like there are a few view overlapping all inside of a NSScrollView
    > (scroll bars appear when the accordion is expanded pass the height of the
    > window.) Is there some direction you could point me to get started on
    > building something like this? Is there an open source project that has
    > something similar I could take a look at?
    >
    > Thanks in advance!
    >
  • On 12/17/07 11:06 AM, Nat Edar said:

    > I'm in need of a view that acts just like the "accordion" view in CSSEdit.
    > Here's an example--the accordion is on the right hand side:
    > http://macrabbit.com/cssedit/screenshots/VisualEditing.jpg
    > It looks like there are a few view overlapping all inside of a NSScrollView
    > (scroll bars appear when the accordion is expanded pass the height of the
    > window.) Is there some direction you could point me to get started on
    > building something like this?

    <http://developer.apple.com/samplecode/Reducer/index.html>

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
previous month december 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
31            
Go to today