Fix NSWindow size?

How can we fix the NSWindow size so that the user cannot resize it by dragging it with the mouse or is there a way that all subviews windows change when users change the window size, in fact, the problem is when the user resizes the window, subviews not resizses, then I would like to block window resizing?

+3
source share
3 answers

I may miss the point here (and a little late), but can you set the "limits" in the window itself?

If the min and max sizes are the same, this prevents resizing.

enter image description here

+5
source

, Interface Builder :

, " " (-3), ( ), , . : (1) , ; (2) , , , .

, (-1). , , IBOutlet :

[self.theWindow setStyleMask:NSBorderlessWindowMask];
+1

, , , , ( setShowsResizeIndicator), ...

- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize

... the NSWindowDelegate delegate method so that it simply returns the existing window size.

It is odd that there is no setCanResize: method there, but there you go.

0
source

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


All Articles