Moving a window by dragging a background (movableByWindowBackground)

I have a window in which I want users to be able to navigate by dragging anywhere in the contents of the window (and not just the title bar). I know that this can be done using the NSWindow movableByWindowBackground method NSWindow movableByWindowBackground , however this does not seem to work on its own.

I compile that an NSView mouseDownCanMoveWindow override of NSView mouseDownCanMoveWindow may be required. But I cannot easily do this for all parent views (split views, etc.). Creating a texture window did not help. Not surprisingly, subclassing NSWindow to override isMovableByWindowBackground did not help either.

Is it really necessary to subclass all parent views in a window to make this work?

+6
source share
1 answer

In OS X 10.11, the NSWindow property movableByWindowBackground - YES .

In this case, there is no longer a need for a subclass.

+5
source

Source: https://habr.com/ru/post/981431/


All Articles