7

In Lion, the standard resize method for windows changed from the lower-right corner to all sides, with an invisible area to click and drag. I have a custom borderless window, similar to the App Store, on which I would like to have this resize behavior (currently, I have a custom resizer view in the bottom right). I searched for "10.7" in the NSWindow documentation, but none of the newly available messages seem to suggest a way to enable this.

Thanks.

Jens Ayton
  • 14,532
  • 3
  • 33
  • 47

1 Answers1

6

I don't know which object is responsible for setting it up, but NSWindow now has tracking areas in the corners and edges (Open Quartz Debug and check "Show tracking rectangles" to see what I mean). You could emulate this behavior without too much difficulty -- it's basic geometry.

Richard
  • 3,316
  • 30
  • 41
  • 10
    This definitely would work, but it turns out it's a lot simpler and a bad mistake on my part. I was constructing my window with `NSBorderlessWindowMask`, which was all that was necessary on SL, since all other behavior was custom. On Lion, since I'm using the system-provided resizing, I needed to add `NSResizableWindowMask`. Thanks for your help. –  Aug 30 '11 at 17:13
  • 5
    Another note for any future Googlers: make sure you only enable the resizable mask on Lion, or you'll get the standard window border on Snow Leopard as well as your custom one. –  Aug 31 '11 at 22:09
  • @Nate what's your preferred way to ensure that it's on Lion? It can't be an availability test -- the mask has been available for a long time already! – Richard Sep 01 '11 at 00:08
  • 1
    A simple way to do it that I've seen but haven't tried is `NSClassFromString(@"NSPopover") != nil`. Personally, I use `Gestalt(gestaltSystemVersionMinor, &minor)`, then `minor > 6` (where `minor` is an `SInt32`). –  Sep 01 '11 at 21:49