Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSAlertMBS class.

NSAlertMBS.accessoryView as NSViewMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The accessory view displayed in the alert panel.

By default, the accessory view is positioned below the informative text and the suppression button (if any) and above the alert buttons, left-aligned with the informative text. If you want to customize the location of the accessory view, you must first call layout method.
(Read and Write property)

NSAlertMBS.alertStyle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The alert style.

Value can be:
NSWarningAlertStyle0Warning
NSInformationalAlertStyle1Information
NSCriticalAlertStyle2Critical Error
(Read and Write property)

NSAlertMBS.helpAnchor as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The help anchor to use.

(Read and Write property)

NSAlertMBS.icon as NSImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Custom icon for dialog.

By default uses the image named NSApplicationIcon.
(Read and Write property)

NSAlertMBS.informativeText as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The informative text.

(Read and Write property)

NSAlertMBS.messageText as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The message text.

(Read and Write property)

Some examples using this property:

NSAlertMBS.showsHelp as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether to show help button.

True adds a help button to the alert panel. When the help button is pressed, the delegate is first consulted. If the event does not implement ShowHelp event or returns false, then NSHelpManager.openHelpAnchor is called with a nil book and the anchor specified by HelpAnchor, if any. An exception will be raised if the delegate returns false and there is no help anchor set.
(Read and Write property)

Some examples using this property:

NSAlertMBS.ShowsSuppressionButton as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Indicates whether or not the alert should contain a suppression checkbox.

The default is false. This checkbox is typically used to give the user an option to not show this alert again. If shown, the suppression button will have a default localized title similar to @"Do not show this message again". You can customize this title using alert.suppressionButton.Title. When the alert is dismissed, you can get the state of the suppression button, using [[alert suppressionButton] state] and store the result in user defaults, for example. This setting can then be checked before showing the alert again. By default, the suppression button is positioned below the informative text, and above the accessory view (if any) and the alert buttons, and left-aligned with the informative text. However do not count on the placement of this button, since it might be moved if the alert panel user interface is changed in the future. If you need a checkbox for purposes other than suppression text, it is recommended you create your own using an accessory view.
(Read and Write property)

Some examples using this property:

NSAlertMBS.suppressionButton as Variant

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns a suppression button which may be customized, including the title and the initial state.
Example
// make dialog
dim a as NSAlertMBS = NSAlertMBS.alertWithMessageText("Hello World", "First Button", "Second Button")

// get button
dim suppressionButton as NSButtonMBS = a.suppressionButton

// change title
suppressionButton.title = "Hello World Button"

// want to show it
a.ShowsSuppressionButton = true

// and show dialog
call a.runModal

You can also use this method to get the state of the button after the alert is dismissed, which may be stored in user defaults and checked before showing the alert again. In order to show the suppression button in the alert panel, you must set ShowsSuppressionButton to true.
Returns NSButtonMBS object.
(Read only property)

Some examples using this property:

NSAlertMBS.TimedOut as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Whether we got a timeout.

This is set to true when a timeout occurred.
(Read only property)

NSAlertMBS.timeOut as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Timeout for the dialog.

Set this to the number of seconds after which the dialog should close.
(Read and Write property)

NSAlertMBS.window as Variant

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa MBS MacCocoa Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Returns the application-modal panel or the document-modal sheet corresponding to this alert.

(Read only property)

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


The biggest plugin in space...