Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSAlertMBS class.
NSAlertMBS.addButtonWithTitle(title as string) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Buttons are added from right to left (for left to right languages).
Returns NSButtonMBS object.
Some examples using this method:
NSAlertMBS.beginSheetModalForWindow(win as DesktopWindow)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 22.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If the alert has an alertStyle of NSCriticalAlertStyle, it will be shown as a "critical" sheet; it will otherwise be presented as a normal sheet.
Calls later SheetDidEnd event with the result.
Please keep a reference to the dialog object alive to avoid trouble.
e.g. store reference in parent window, global property or app property.
See also:
NSAlertMBS.beginSheetModalForWindow(win as NSWindowMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If the alert has an alertStyle of NSCriticalAlertStyle, it will be shown as a "critical" sheet; it will otherwise be presented as a normal sheet.
Calls later SheetDidEnd event with the result.
Please keep a reference to the dialog object alive to avoid trouble.
e.g. store reference in parent window, global property or app property.
See also:
NSAlertMBS.beginSheetModalForWindow(win as window)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If the alert has an alertStyle of NSCriticalAlertStyle, it will be shown as a "critical" sheet; it will otherwise be presented as a normal sheet.
Calls later SheetDidEnd event with the result.
Please keep a reference to the dialog object alive to avoid trouble.
e.g. store reference in parent window, global property or app property.
See also:
NSAlertMBS.buttons as Variant()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns NSButtonMBS array.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The SheetDidEnd event will not run.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Use properties to configure the dialog.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Can be used to indicate that the alert panel should do immediate layout, overriding the default behavior of laying out lazily just before showing panel. You should only call this method if you want to do your own custom layout after it returns. You should call this method only after you have finished with NSAlert customization, including setting message and informative text, and adding buttons and an accessory view if needed. You can make layout changes after this method returns, in particular to adjust the frame of an accessory view. Note that the standard layout of the alert may change in the future, so layout customization should be done with caution.
NSAlertMBS.runModal as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSAlertMBS.SetTextAlignment(value as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa | MBS MacCocoa Plugin | 22.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
on macOS Big Sur and later, the default alignment is center.
If you show multiple lines of text, it may be easier to read with left alignment.
This calls layout method to layout the dialog.
See NSParagraphStyleMBS or NSTextMBS class for the alignment constants.
The items on this page are in the following plugins: MBS MacCocoa Plugin.