Platforms to show: All Mac Windows Linux Cross-Platform

NSWindowDelegateMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Xojo class for a cocoa windows delegate.
Example
// keep the window frame (including title bar) at a 16:9 aspect ratio while the user resizes it
// MyWindowDelegate is a subclass of NSWindowDelegateMBS with the windowWillResize event implemented.
// WindowDelegate is a property of the window: WindowDelegate As MyWindowDelegate
WindowDelegate = New MyWindowDelegate(Self)

// in MyWindowDelegate:
Function windowWillResize(win As NSWindowMBS, newFrameSize As NSSizeMBS, newSize As NSSizeMBS) As NSSizeMBS Handles windowWillResize
// newFrameSize is the size the user wants, return the size to use
Return NSMakeSizeMBS(newFrameSize.Width, newFrameSize.Width * 9 / 16)
End Function

The NSWindowDelegate protocol defines the methods that a delegate of NSWindow should implement. All methods in this protocol are optional.

By implementing these methods, the delegate may respond to window resizing, moving, exposing, minimizing, and a number of other window events.

This class has no subclasses.

Blog Entries

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS MacCocoa Plugin.


NSWindowControllerMBS   -   NSWindowMBS


The biggest plugin in space...