The value of Buttons is the sum of values that describe the number and labelling of the buttons, the icon, and the default button.There are three groups of button values each group offers choices for a particular feature.ĭisplay Abort, Retry, and Ignore buttons. You get a fixed choice of button text and button positions. The MsgBox buttons are not localized - this is a known bug (feedback report 4665).īuttons is an optional parameter that enables you to customize the buttons and icon displayed in the message box to a limited extent. This is the result of changes made by Apple in HID specs. On macOS only the Caution icon is displayed. Multiple paragraphs can be passed in the message parameter by separating each paragraph with the EndOfLine function.Ĭlosing a MsgBox gives the focus back to the window, which calls its Activate event. On Macintosh, the Message box has a fixed width and the text word-wraps to fit the width of the MsgBox.
XOJO MSGBOX WINDOWS
On Windows and Linux, the width increases to accommodate the longest paragraph. The dialog can be closed either by clicking OK or clicking the Close widget. On Windows, the dialog also has a Close widget in its Title bar. The Message box opened by MsgBox has a Title bar. MsgBox is also ideally suited for porting VisualBasic programs to Xojo.
It enables you to add up to three buttons, label them in any way, and take any action after the user clicked a button. For other situations, the MessageDialog class is more appropriate. The MsgBox function is recommended for simple informational messages only. Instead use the Debugger, System.DebugLog or your own logging mechanism.Ī message can be presented to the user with either the MsgBox function or the MessageDialog class. The displaying of the Message Box will alter event order and may give unexpected results. You should avoid using MsgBox for displaying debugging messages. If you want to specify a value for Title, you must handle the result of the MsgBox call and also pass a value for buttons. Optional text displayed in the Title bar (Windows and Linux). You must handle the result if you pass a value for buttons.
XOJO MSGBOX CODE
Optional code indicating the icon and choice of buttons displayed in the Message box. See the example in the Examples section for MsgBox. They appear in the same font size on other platforms. If you use two EndofLine characters to form a paragraph break, the second and following paragraphs will be de-emphasized on Macintosh, Vista, and Linux. This parameter contains the main message of the dialog. If you don't use the optional parameters, MsgBox can be called without handling result. It returns 1 if the OK button is clicked. The message is output to the console/terminal. Usage (Web apps)ĭisplays message in a browser dialog with a single OK button. With the exception of simple message boxes, you should use the MessageDialog class instead. Displays message box showing the string passed.