wxMessageDialog(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’¬ wxMessageDialog β€” NAME

ok so bestie, welcome to wxMessageDialog πŸ’– β€” this class is literally a dialog that shows a message, single-line or multi-line, with a lil choose-your-own-adventure of buttons: OK, Yes, No and Cancel. that's it, that's the whole vibe. no cap.


✨ DESCRIPTION ✨

πŸŽ€ Styles

she supports the following styles, and yes you gotta read all of them, i know, i know:

  • wxOK β€” drops an Ok button in the message box. can be combined with wxCANCEL.
  • wxCANCEL β€” drops a Cancel button in. must be combined with either wxOK or wxYES_NO, like it does not fly solo.
  • wxYES_NO β€” puts Yes and No buttons in the box. highly recommended you always pair this with wxCANCEL, otherwise the message box won't have a close button under wxMSW and the user is literally forced to answer it 😭 no escape, no exit, just vibes and consequences.
  • wxHELP β€” puts a Help button in the box. this button can have a special appearance or be specially positioned if its label isn't changed from the default one. BUT heads up: using this button is not supported when showing a message box from a non-main thread in wxOSX/Cocoa πŸ™ˆ. available since wxWidgets 2.9.3.
  • wxNO_DEFAULT β€” makes the "No" button the default. can only be used with wxYES_NO.
  • wxCANCEL_DEFAULT β€” makes the "Cancel" button the default. can only be used with wxCANCEL. this style is currently not supported (and ignored) in wxOSX.
  • wxYES_DEFAULT β€” makes the "Yes" button the default. this is already the default behaviour, and this flag exists solely for symmetry with wxNO_DEFAULT. aesthetic purposes only πŸ’….
  • wxOK_DEFAULT β€” makes the "OK" button the default. also already the default behaviour, also exists solely for symmetry with wxCANCEL_DEFAULT. matching set ✨.
  • wxICON_NONE β€” displays no icon in the dialog if possible (an icon might still show up if the current platform mandates its use, so no promises). you can use this style to stop the dialog from using the default icon based on wxYES_NO presence, as explained down in the wxICON_QUESTION and wxICON_INFORMATION docs.
  • wxICON_ERROR β€” displays an error icon in the dialog.
  • wxICON_WARNING β€” displays a warning icon. use this for informative warnings, or, combined with wxYES_NO or wxCANCEL, for questions that have potentially serious consequences (in that case a caution icon is used on macOS πŸ‘€).
  • wxICON_QUESTION β€” displays a question mark symbol. this icon is automatically used with wxYES_NO, so spelling it out is usually unnecessary. not supported for message dialogs under wxMSW when a task dialog is used to implement them (i.e. when running under Windows Vista or later), because Microsoft guidelines say no icon should be used for routine confirmations. if you specify it anyway, no icon gets displayed. periodt.
  • wxICON_INFORMATION β€” displays an information symbol. this one's used by default when wxYES_NO isn't given, so again, usually unnecessary to say it explicitly.
  • wxICON_EXCLAMATION β€” alias for wxICON_WARNING.
  • wxICON_HAND β€” alias for wxICON_ERROR.
  • wxICON_AUTH_NEEDED β€” displays an authentication needed symbol. only supported for message dialogs under wxMSW when a task dialog is used to implement them (i.e. when running under Windows Vista or later). in other cases the default icon selection logic takes over. ngl you can combine this with other styles to get a fallback β€” for instance, wxICON_AUTH_NEEDED | wxICON_QUESTION will show a shield symbol on Windows Vista or above and a question symbol everywhere else πŸ›‘οΈβ“. available since wxWidgets 2.9.5.
  • wxSTAY_ON_TOP β€” makes the message box stay on top of all other windows, not just its parent (currently implemented only under MSW and GTK). main character energy fr.
  • wxCENTRE β€” centres the message box on its parent, or on the screen if no parent was specified. setting this style under MSW makes no difference, because the dialog is always centered on the parent there anyway. slay.
See: Overview cmndlg

and bc she's a whole queen with a lineage πŸ‘‘, this class is derived, and can use functions, from:

  • wxDialog
  • wxTopLevelWindow
  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxMessageDialog


πŸ¦‹ DATA TYPES πŸ¦‹

wxMessageDialog() :: wx:wx_object().

🌸 FUNCTIONS 🌸

destroy(This :: wxMessageDialog()) -> ok.

Destroys the object. bye bestie πŸ‘‹πŸ’€

new(Parent, Message, [Option]) -> wxMessageDialog()

when
    Parent :: wxWindow:wxWindow(),
    Message :: unicode:chardata(),
    Option ::
        {caption, unicode:chardata()} |
        {style, integer()} |
        {pos, {X :: integer(), Y :: integer()}}.

Constructor specifying the message box properties. ✨

use wxDialog:showModal/1 to actually show the dialog β€” that's the moment she steps out πŸ’….

style may be a bit list of the identifiers described above.

okay important: not all styles are compatible 😀 β€” only one of wxOK and wxYES_NO may be specified (and one of them must be specified), and at most one default button style can be used, and it's only valid if the corresponding button is actually shown in the message box. do not try to be cute about this.

made with love by Ericsson AB, shipping with wx 2.6 β€” that's the source and the version, and honestly she's a legend fr fr πŸ’–βœ¨πŸŽ€πŸ¦‹ took care of you, now go show that modal 🫢

πŸ“¦ where this page comes from