PDA

View Full Version : split view and snapping resizing




Chirone
Apr 13, 2009, 07:40 PM
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



kainjow
Apr 14, 2009, 12:47 AM
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 (http://www.brockerhoff.net/src/rbs.html), 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.