Subscribe to
Posts
Comments
NSLog(); Header Image

Drag to a Drawer

In Mail, when you drag a message one way, the drawer opens on that side, and vice versa. There's a bit of a "dead zone" in the middle where a drawer doesn't open at all, but clearly that depends on the initial location of the click-down: towards the side of the window and the dead zone is smaller or you'd be off the window before the drawer opened.

I was nearly certain that this was a "for free" behavior in Cocoa, but as we look to add and refine this feature (it's added, but it only works on one side) to PulpFiction, we realize it's not. A search of the Apple docs (and Example applications) yields nothing, as does a search of cocoa.mamasam.com (to which I've contributed - and to which you should as well).

Anyone got any input here? We're stuck. Not wanting to roll our own if we don't have to, but unable to find a pre-rolled solution.

4 Responses to "Drag to a Drawer"

  1. nope, haven't seen any code anywhere to do this.. actually, I don't think I've seen any apps other than Mail which do this.

    there are a lot of things like this which I wish Apple would release as sample code.

  2. We've now implemented it.

  3. Apple's Mail is the only program I've seen with that behavior (though I haven't exactly searched for it much). If you do end up rolling it yourself, maybe you could write it up as a CocoaDevCentral article or something 🙂

  4. oops, I was a bit slow in posting that comment I see...