Einhugur macOS Bridge plugin. |

# EinhugurMacOSBridge.NSAlert Class (desktop)

A modal dialog or sheet attached to a document window.
The methods of the NSAlert class allow you to specify alert level, alert text, button titles, and a custom icon should you require it.
See also our free X-Platform-Alert on Github which uses the NSAlert on MacOS Systems but gives cross platform experience:
https://github.com/einhugur/X-Platform-Alert

EinhugurCoreBridge.NSObject
NSAlert

class EinhugurMacOSBridge.NSAlert

#### Constructors

NSAlert | Default constructor with no parameters.

#### Properties

AccessoryView | Sets or gets the alert’s accessory view.
AlertStyle | Indicates the alert’s severity level.
Buttons | The array of response buttons for the alert.
ClassName (Inherited) (desktop - console) | Returns the name of the Cocoa class under the hood as String.
Handle (Inherited) | Returns Integer handle to the native NSObject structure.
Icon | The custom icon displayed in the alert.
InformativeText | The alert’s informative text.
MessageText | The alert’s message text or title.
ShowsSuppressionButton | Specifies whether the alert includes a suppression checkbox, which you can employ to allow a user to opt out of seeing the alert again.
SuppressionButton | The alert’s suppression checkbox.

#### Methods

AddButtonWithTitle | Adds a button with a given title to the alert.
BeginSheetModalForWindow | Runs the alert modally as a sheet attached to the specified window. This variation takes new style Xojo DesktopWindow.
BeginSheetModalForWindow | Runs the alert modally as a sheet attached to the specified window. This variation takes old style Xojo Window.
shared Cast | Does deep cast on incoming NSObject to NSAlert
Release (Inherited) | Releases the NSObject.
Retain (Inherited) | Retains the NSObject
RunModal | Runs the alert as an app-modal dialog and returns the constant that identifies the button clicked.

#### Delegates

AlertCompletionDelegate | Delegate to get callback when showing the NSAlert modal only to one window.

#### Enumerations

StyleValues | Enum representing styles for NSAlert.

#### Constants

Version = 5.0 (Inherited) |

#### Examples

using EinhugurMacOSBridge
var alert as NSAlert = new NSAlert()
alert.MessageText = "Some alert"
alert.InformativeText = "This is a test alert"
call alert.AddButtonWithTitle("Do Something")
// Putting destructive action, makes the button have additional warning indicator on Big Sur
alert.AddButtonWithTitle("Delete something").HasDestructiveAction = true
call alert.AddButtonWithTitle("Cancel")
var result as Integer = alert.RunModal()
select case result
case 1000
// React to the Do something command
case 1001
// React to the Delete something command
case 1002
// React to the Cancel command
end select

#### Supported Platforms:

- macOS Intel 64 bit
- macOS Apple Silicon

#### Unsupported Platforms:

- Windows 32 bit
- Windows 64 bit
- Windows ARM 64 bit
- Linux 32 bit
- Linux 64 bit
- Linux ARM 32 bit
- Linux ARM 64 bit