lmirosevic
lmirosevic

Reputation: 16317

Resize NSWindow from bottom left corner only?

I am writing an application that sits in the OS X menu bar and when you press its icon a little NSPanel opens up. I would like the user to be able to resize it, but only by dragging the bottom left corner. I want to prevent them from being able to drag the top edge down and "unstick" the window from the menu bar.

Upvotes: 1

Views: 503

Answers (1)

Mundi
Mundi

Reputation: 80265

Just override touchesBegan mouseDown: and pass on the drag only if it is in the designated corner, discarding other touches.

See Cocoa Event Handling Guide

Upvotes: 1

Related Questions