How to hide the divider in a collapsed NSSplitView pane

  • Hello List,

      I've done a lot of testing and googling but I can't figure out how
    or even if it is possible to completely hide a divider of a NSSplitView.

    Suppose I have a split view setup like this:

        A      B
    |------|------|

    B is collapsible through a button, not through dragging (there is a
    min and max constraint on the divider too). I have a button that
    toggles the view from collapsed to expanded and back. However, when
    view is collapsed the divider is still visible on the right edge of
    the split view.

    I've tried sizing the subviews myself in my own custom SplitView
    subclass - not using NSSplitView's -setPosition: - but even that
    doesn't help. The splitview somehow adjusts the the frames after they
    have been set so the divider stays visible, not matter what you do.

    Instruments is an example of an app that has splitters that work like
    I want it. The Extended Details pane toggles on and off using a button
    (on the bottom toolbar). When collapsed there is no divider visible
    and you can expand it by using the button only.

    Is that something I can do with NSSplitView? If so, how?

    Regards
    Markus
    --
  • Am 22.06.2008 um 00:38 Uhr schrieb Markus Spoettl:

    > Is that something I can do with NSSplitView? If so, how?

    The documentation for NSSplitView says:

    > dividerThickness
    > Returns the thickness of the divider.
    >
    > - (CGFloat)dividerThickness
    >
    > Discussion
    > You can subclass NSSplitView and override this method to change the
    > divider’s size, if necessary.
    >

    Andreas
  • Hi Markus,

    AppKit release notes say this:

    "A common UI pattern now is to provide a button to show and hide one
    subview or another of a split view, and completely hide the divider
    when the subview between it and the edge of the window is hidden. To
    make it easy for you to do this there is a new -
    splitView:shouldHideDividerAtIndex: delegate method you can implement."

    M

    On 21 Jun 2008, at 23:38, Markus Spoettl wrote:

    > Hello List,
    >
    > I've done a lot of testing and googling but I can't figure out how
    > or even if it is possible to completely hide a divider of a
    > NSSplitView.
    >
    > Suppose I have a split view setup like this:
    >
    > A      B
    > |------|------|
    >
    > B is collapsible through a button, not through dragging (there is a
    > min and max constraint on the divider too). I have a button that
    > toggles the view from collapsed to expanded and back. However, when
    > view is collapsed the divider is still visible on the right edge of
    > the split view.
    >
    > I've tried sizing the subviews myself in my own custom SplitView
    > subclass - not using NSSplitView's -setPosition: - but even that
    > doesn't help. The splitview somehow adjusts the the frames after
    > they have been set so the divider stays visible, not matter what you
    > do.
    >
    > Instruments is an example of an app that has splitters that work
    > like I want it. The Extended Details pane toggles on and off using a
    > button (on the bottom toolbar). When collapsed there is no divider
    > visible and you can expand it by using the button only.
    >
    > Is that something I can do with NSSplitView? If so, how?
    >
    > Regards
    > Markus
    > --
    > __________________________________________
    > Markus Spoettl
  • Hi Milen,

    On Jun 21, 2008, at 6:21 PM, Milen Dzhumerov wrote:
    > "A common UI pattern now is to provide a button to show and hide one
    > subview or another of a split view, and completely hide the divider
    > when the subview between it and the edge of the window is hidden. To
    > make it easy for you to do this there is a new -
    > splitView:shouldHideDividerAtIndex: delegate method you can
    > implement."

    Ahhh. That's great, I just tried. Thanks so much for the tip!

    Regards
    Markus
    --
  • On Jun 21, 2008, at 5:53 PM, Andreas Mayer wrote:
    > The documentation for NSSplitView says:
    >
    >> dividerThickness
    >> Returns the thickness of the divider.
    >>
    >> - (CGFloat)dividerThickness
    >>
    >> Discussion
    >> You can subclass NSSplitView and override this method to change the
    >> divider’s size, if necessary.

    I guess I didn't think of that, thanks for the tip. There's actually a
    better way that Milen pointed out, though.

    Regards
    Markus
    --
  • Am 22.06.2008 um 03:58 Uhr schrieb Markus Spoettl:

    > There's actually a better way that Milen pointed out, though.

    If you don't need to support systems earlier than 10.5, yes.

    Andreas
  • On Jun 21, 2008, at 7:53 PM, Andreas Mayer wrote:
    >> There's actually a better way that Milen pointed out, though.
    >
    > If you don't need to support systems earlier than 10.5, yes.

    Yes, that's right. I forgot to mention that.

    Regards
    Markus
    --
previous month june 2008 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