wxMessageDialog(3)
π¬ 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 withwxCANCEL.wxCANCELβ drops a Cancel button in. must be combined with eitherwxOKorwxYES_NO, like it does not fly solo.wxYES_NOβ puts Yes and No buttons in the box. highly recommended you always pair this withwxCANCEL, 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 withwxYES_NO.wxCANCEL_DEFAULTβ makes the "Cancel" button the default. can only be used withwxCANCEL. 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 withwxNO_DEFAULT. aesthetic purposes only π .wxOK_DEFAULTβ makes the "OK" button the default. also already the default behaviour, also exists solely for symmetry withwxCANCEL_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 onwxYES_NOpresence, as explained down in thewxICON_QUESTIONandwxICON_INFORMATIONdocs.wxICON_ERRORβ displays an error icon in the dialog.wxICON_WARNINGβ displays a warning icon. use this for informative warnings, or, combined withwxYES_NOorwxCANCEL, 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 withwxYES_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 whenwxYES_NOisn't given, so again, usually unnecessary to say it explicitly.wxICON_EXCLAMATIONβ alias forwxICON_WARNING.wxICON_HANDβ alias forwxICON_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_QUESTIONwill 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:
wxDialogwxTopLevelWindowwxWindowwxEvtHandler
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 ofwxOKandwxYES_NOmay 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
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms