3

I'm building an app for Mac OSX in Objective C, and I'm wondering if there's any built in support for "docking" behavior. What I mean by this is having a main window with "slots" with other windows that can either be free floating or snap into place in one of the slots of the main window. The user would be able to click and drag windows, move them around and "dock" them where they want them to be. An example of an environment that has this kind of support is QT, but I'd rather use Cocoa than QT.

So far I've had no luck finding anything on the topic.

Sunny724
  • 156
  • 2
  • 12
  • Did you start subclassing `NSWindow` and related classes and poked around a bit? I think you should be able to overwrite the dragging events and snap the windows if desired from there... – Julian F. Weinert Jan 18 '17 at 21:18

1 Answers1

1

There used to be a standard class that allowed you to implement the feature you just mentioned (called a window drawer). I do believe they have deprecated that so you will not be able to use it due to poor design reasons. If you believe that it will truly fit your need, you can create another window (with no borders and toolbar) that slides out from the side of the main window, and moves around as the main window is dragged around.

TheAmateurProgrammer
  • 9,252
  • 8
  • 52
  • 71
  • Agreed. But would also say that Apple deprecated this for a reason and it goes against best practice and Apples design recommendations. – d00dle Jan 18 '17 at 20:26