A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://wxpython.org/Phoenix/docs/html/wx.MessageDialog.html below:

wx.MessageDialog — wxPython Phoenix 4.2.4a1 documentation

wx.MessageDialog¶

This class represents a dialog that shows a single or multi-line message, with a choice of wx.OK, Yes, No and Cancel buttons.

Window Styles¶

This class supports the following styles:

Class Hierarchy¶

Inheritance diagram for class

MessageDialog

:

Control Appearance¶ Methods Summary¶ Properties Summary¶ Class API¶
class wx.MessageDialog(Dialog)¶

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.


Methods¶
__init__(self, parent, message, caption=MessageBoxCaptionStr, style=OK | CENTRE, pos=DefaultPosition)¶

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.

Parameters:
  • parent (wx.Window) – Parent window.

  • message (string) – Message to show in the dialog.

  • caption (string) – The dialog title.

  • style (long) – Combination of style flags described above.

  • pos (wx.Point) – Dialog position (ignored under MSW).

Return type:

None


GetCancelLabel(self)¶
Return type:

str


GetCaption(self)¶
Return type:

str


static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
Parameters:

variant (WindowVariant)

Return type:

wx.VisualAttributes


GetEffectiveIcon(self)¶
Return type:

int


GetExtendedMessage(self)¶
Return type:

str


GetHelpLabel(self)¶
Return type:

str


GetMessage(self)¶
Return type:

str


GetMessageDialogStyle(self)¶
Return type:

int


GetNoLabel(self)¶
Return type:

str


GetOKLabel(self)¶
Return type:

str


GetYesLabel(self)¶
Return type:

str


HasCustomLabels(self)¶
Return type:

bool


SetExtendedMessage(self, extendedMessage)¶

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.

Parameters:

extendedMessage (string)

Return type:

None

Added in version 2.9.0.


SetHelpLabel(self, help)¶

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.

Parameters:

help (MessageDialogButtonLabel)

Return type:

bool

Added in version 2.9.3.


SetMessage(self, message)¶

Sets the message shown by the dialog.

Parameters:

message (string)

Return type:

None

Added in version 2.9.0.


SetOKCancelLabels(self, ok, cancel)¶

Overrides the default labels of the wx.OK and Cancel buttons.

Please see the remarks in SetYesNoLabels documentation.

Parameters:
  • ok (MessageDialogButtonLabel)

  • cancel (MessageDialogButtonLabel)

Return type:

bool

Added in version 2.9.0.


SetOKLabel(self, ok)¶

Overrides the default label of the wx.OK button.

Please see the remarks in SetYesNoLabels documentation.

Parameters:

ok (MessageDialogButtonLabel)

Return type:

bool

Added in version 2.9.0.


SetYesNoCancelLabels(self, yes, no, cancel)¶

Overrides the default labels of the Yes, No and Cancel buttons.

Please see the remarks in SetYesNoLabels documentation.

Parameters:
  • yes (MessageDialogButtonLabel)

  • no (MessageDialogButtonLabel)

  • cancel (MessageDialogButtonLabel)

Return type:

bool

Added in version 2.9.0.


SetYesNoLabels(self, yes, no)¶

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?")
Parameters:
  • yes (MessageDialogButtonLabel)

  • no (MessageDialogButtonLabel)

Return type:

bool

Added in version 2.9.0.


ShowModal(self)¶

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.

Return type:

int


Properties¶
CancelLabel¶

See GetCancelLabel


Caption¶

See GetCaption


EffectiveIcon¶

See GetEffectiveIcon


ExtendedMessage¶

See GetExtendedMessage and SetExtendedMessage


HelpLabel¶

See GetHelpLabel and SetHelpLabel


Message¶

See GetMessage and SetMessage


MessageDialogStyle¶

See GetMessageDialogStyle


NoLabel¶

See GetNoLabel


OKLabel¶

See GetOKLabel and SetOKLabel


YesLabel¶

See GetYesLabel


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4