split view and snapping resizing

Discussion in 'Mac Programming' started by Chirone, Apr 13, 2009.

  1. macrumors 6502

    Mar 2, 2009
    as some of you may be aware there are applications with little triangles on the split views, and if you click them (or double click) then it automatically resizes the split view so that a custom view is hidden or made visible, similar to dragging the split view control to make the custom view hidden or visible but it does it without the dragging

    does anyone know how you do this?

    or also being able to snap windows to each other like you can in adobe's software
  2. Moderator emeritus


    Jun 15, 2000
    All that can be down with NSSplitView and there's code out there for it (see cocoadev.com) but it's a pain. I'd recommend RBSplitView, which is a third-party alternative that makes working with these controls a lot easier.

    For the second part look here http://www.cocoadev.com/index.pl?MagneticWindows

    BTW I usually search cocoadev.com first when I'm trying to find some sample code or tips/tricks on certain classes. You're almost guaranteed to find what you're looking for there.

Share This Page