Table of Contents

Class NSWindow

Namespace
CarinaStudio.MacOS.AppKit
Assembly
CarinaStudio.AppBase.MacOS.dll

NSWindow.

public class NSWindow : NSResponder, IDisposable, IEquatable<NSObject>
Inheritance
NSWindow
Implements
Inherited Members
Extension Methods

Constructors

NSWindow(NSRect, StyleMask, BackingStoreType, bool)

Initialize new NSWindow instance.

public NSWindow(NSRect contentRect, NSWindow.StyleMask style, NSWindow.BackingStoreType backingStoreType, bool defer)

Parameters

contentRect NSRect

Origin and size of the window’s content area in screen coordinates.

style NSWindow.StyleMask

Style.

backingStoreType NSWindow.BackingStoreType

How the drawing done in the window is buffered by the window device

defer bool

True to create the window device until the window is moved onscreen.

NSWindow(NSRect, StyleMask, BackingStoreType, bool, NSObject?)

Initialize new NSWindow instance.

public NSWindow(NSRect contentRect, NSWindow.StyleMask style, NSWindow.BackingStoreType backingStoreType, bool defer, NSObject? screen)

Parameters

contentRect NSRect

Origin and size of the window’s content area in screen coordinates.

style NSWindow.StyleMask

Style.

backingStoreType NSWindow.BackingStoreType

How the drawing done in the window is buffered by the window device

defer bool

True to create the window device until the window is moved onscreen.

screen NSObject

The screen on which the window is positioned.

NSWindow(Class, IntPtr, bool)

Initialize new NSWindow instance.

protected NSWindow(Class cls, IntPtr handle, bool ownsInstance)

Parameters

cls Class

Class of instance.

handle nint

Handle of instance.

ownsInstance bool

True to owns the instance.

NSWindow(IntPtr, bool, bool)

Initialize new NSWindow instance.

protected NSWindow(IntPtr handle, bool verifyClass, bool ownsInstance)

Parameters

handle nint

Handle of instance.

verifyClass bool

True to verify whether instance is NSWindow or not.

ownsInstance bool

True to owns the instance.

Properties

Appearance

Get or set appearance of window.

public NSAppearance? Appearance { get; set; }

Property Value

NSAppearance

ContentView

Get or set content view of window.

public NSView? ContentView { get; set; }

Property Value

NSView

Delegate

Get or set object which conforms to NSWindowDelegate protocol to receive call-back from window.

public NSObject? Delegate { get; set; }

Property Value

NSObject

Subtitle

Get or set subtitle of window.

public string Subtitle { get; set; }

Property Value

string

Title

Get or set title of window.

public string Title { get; set; }

Property Value

string

Methods

Close()

Close the window.

public void Close()

Initialize(IntPtr, NSRect, StyleMask, BackingStoreType, bool)

Initialize allocated instance.

protected static IntPtr Initialize(IntPtr obj, NSRect contentRect, NSWindow.StyleMask style, NSWindow.BackingStoreType backingStoreType, bool defer)

Parameters

obj nint
contentRect NSRect
style NSWindow.StyleMask
backingStoreType NSWindow.BackingStoreType
defer bool

Returns

nint

Handle of initialized instance

Initialize(IntPtr, NSRect, StyleMask, BackingStoreType, bool, NSObject?)

Initialize allocated instance.

protected static IntPtr Initialize(IntPtr obj, NSRect contentRect, NSWindow.StyleMask style, NSWindow.BackingStoreType backingStoreType, bool defer, NSObject? screen)

Parameters

obj nint
contentRect NSRect
style NSWindow.StyleMask
backingStoreType NSWindow.BackingStoreType
defer bool
screen NSObject

Returns

nint

Handle of initialized instance

MakeKeyAndOrderFront()

Show the window.

public void MakeKeyAndOrderFront()

Order(OrderingMode, int)

Move the window to the back of its level in the screen list.

public void Order(NSWindow.OrderingMode place, int otherWin)

Parameters

place NSWindow.OrderingMode
otherWin int

OrderBack(NSObject?)

Move the window to the back of its level in the screen list.

public void OrderBack(NSObject? sender = null)

Parameters

sender NSObject

OrderFront(NSObject?)

Move the window to the front of its level in the screen list.

public void OrderFront(NSObject? sender = null)

Parameters

sender NSObject

OrderFrontRegardless()

Move the window to the front of its level, even if its application isn’t active, without changing either the key window or the main window.

public void OrderFrontRegardless()

OrderOut(NSObject?)

Remove the window from the screen list.

public void OrderOut(NSObject? sender = null)

Parameters

sender NSObject

StandardWindowButton(ButtonType)

Get standard button of window.

public NSControl? StandardWindowButton(NSWindow.ButtonType button)

Parameters

button NSWindow.ButtonType

Type of button.

Returns

NSControl

NSControl of button.