GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing docs.wxpython.org — wx.MessageDialog — wxPython 4.3.2 Docs
|
Constructor specifying the message box properties. |
|
Sets the extended message for the dialog: this message is usually an extension of the short message specified in the constructor or set with |
|
Sets the label for the Help button. |
|
Sets the message shown by the dialog. |
|
Overrides the default labels of the |
|
Overrides the default label of the |
|
Overrides the default labels of the Yes, No and Cancel buttons. |
|
Overrides the default labels of the Yes and No buttons. |
|
Shows the dialog, returning one of |
Properties Summary¶See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
Class API¶Possible constructors:
MessageDialog(parent, message, caption=MessageBoxCaptionStr, style=OK|CENTRE, pos=DefaultPosition) -> None
This class represents a dialog that shows a single or multi-line
message, with a choice of wx.OK, Yes, No and Cancel buttons.
Constructor specifying the message box properties.
Use ShowModal to show the dialog.
style may be a bit list of the identifiers described above.
Notice that not all styles are compatible: only one of OK and YES_NO may be specified (and one of them must be specified) and at most one default button style can be used and it is only valid if the corresponding button is shown in the message box.
str
str
variant (WindowVariant)
int
str
str
str
int
str
str
str
bool
Sets the extended message for the dialog: this message is usually an extension of the short message specified in the constructor or set with SetMessage .
If it is set, the main message appears highlighted – if supported – and this message appears beneath it in normal font. On the platforms which don’t support extended messages, it is simply appended to the normal message with an empty line separating them.
extendedMessage (string)
None
Added in version 2.9.0.
Sets the label for the Help button.
Please see the remarks in SetYesNoLabels documentation.
Notice that changing the label of the help button resets its special status (if any, this depends on the platform) and it will be treated just like another button in this case.
help (MessageDialogButtonLabel)
bool
Added in version 2.9.3.
Sets the message shown by the dialog.
message (string)
None
Added in version 2.9.0.
Overrides the default labels of the wx.OK and Cancel buttons.
Please see the remarks in SetYesNoLabels documentation.
ok (MessageDialogButtonLabel)
cancel (MessageDialogButtonLabel)
bool
Added in version 2.9.0.
Overrides the default label of the wx.OK button.
Please see the remarks in SetYesNoLabels documentation.
ok (MessageDialogButtonLabel)
bool
Added in version 2.9.0.
Overrides the default labels of the Yes, No and Cancel buttons.
Please see the remarks in SetYesNoLabels documentation.
yes (MessageDialogButtonLabel)
no (MessageDialogButtonLabel)
cancel (MessageDialogButtonLabel)
bool
Added in version 2.9.0.
Overrides the default labels of the Yes and No buttons.
The arguments of this function can be either strings or one of the standard identifiers, such as ID_APPLY or ID_OPEN . Notice that even if the label is specified as an identifier, the return value of the dialog ShowModal method still remains one of ID_OK , ID_CANCEL , ID_YES or ID_NO values, i.e. this identifier changes only the label appearance but not the return code generated by the button. It is possible to mix stock identifiers and string labels in the same function call, for example:
dlg = wx.MessageDialog(parent, message, caption) dlg.SetYesNoLabels(wx.ID_SAVE, "&Don't save")
Also notice that this function is not currently available on all platforms (although as of wxWidgets 2.9.0 it is implemented in all major ports), so it may return False to indicate that the labels couldn’t be changed. If it returns True, the labels were set successfully.
Typically, if the function was used successfully, the main dialog message may need to be changed, e.g.:
dlg = wx.MessageDialog(parent, message, caption) if dlg.SetYesNoLabels("&Quit", "&Don't quit"): dlg.SetMessage("What do you want to do?") else: # buttons have standard "Yes"/"No" values, so rephrase the question dlg.SetMessage("Do you really want to quit?")
yes (MessageDialogButtonLabel)
no (MessageDialogButtonLabel)
bool
Added in version 2.9.0.
Shows the dialog, returning one of wx.ID_OK, wx.ID_CANCEL, wx.ID_YES, wx.ID_NO or wx.ID_HELP.
Notice that this method returns the identifier of the button which was clicked unlike wx.MessageBox function.
int
See GetCancelLabel
See GetCaption
See GetEffectiveIcon
See GetExtendedMessage and SetExtendedMessage
See GetHelpLabel and SetHelpLabel
See GetMessage and SetMessage
See GetNoLabel
See GetOKLabel and SetOKLabel
See GetYesLabel