"buttons"Write-ConstructThe buttons shown in the message dialog. One of the
:
gtk.BUTTONS_NONE,
gtk.BUTTONS_OK,
gtk.BUTTONS_CLOSE,
gtk.BUTTONS_CANCEL,
gtk.BUTTONS_YES_NO,
gtk.BUTTONS_OK_CANCEL. Default value:
gtk.BUTTONS_NONE"image"Read-WriteThe image for this dialog. Available in GTK+
2.10."message-area"ReadThe gtk.VBox
that corresponds to the message area of this dialog. Available in GTK+ 2.22."message-type"Read-Write-ConstructThe type of message. One of the
:
gtk.MESSAGE_INFO, gtk.MESSAGE_WARNING,
gtk.MESSAGE_QUESTION or
gtk.MESSAGE_ERROR. Default value:
gtk.MESSAGE_INFO"secondary-text"Read-WriteThe secondary text of the message dialog. Default
value: None. Available in GTK+
2.10."secondary-use-markup"Read-WriteIf True the secondary text of the
dialog includes Pango markup. See the pango.parse_markup()
function. Default value: False. Available
in GTK+ 2.10."text"Read-WriteThe primary text of the message dialog. If the dialog
has a secondary text, this will appear as the title. Default
value: None. Available in GTK+
2.10."use-markup"Read-WriteIf True the primary text of the
dialog includes Pango markup. See the pango.parse_markup()
function. Default value: False. Available
in GTK+ 2.10.
"message-border"Read-WriteThe width of border around the label and image in the
message dialog. Allowed values: >= 0. Default value: 12."use-separator"ReadIf True draw a separator line between
the message label and the buttons in the dialog. This property is
available in GTK+ 2.4 and above.
Attributes
"image"ReadThe stock ID image"label"ReadThe label widget that contains the message
text.
gtk.MessageDialog Signal Prototypesgobject.GObject Signal Prototypesgtk.Object Signal Prototypesgtk.Widget Signal Prototypesgtk.Container Signal Prototypesgtk.Window Signal Prototypesgtk.Dialog Signal PrototypesDescriptionThe gtk.MessageDialog
presents a dialog with an image representing the type of message (Error,
Question, etc.) alongside some message text. It's simply a convenience
widget; you could construct the equivalent of gtk.MessageDialog
from gtk.Dialog without
too much effort, but gtk.MessageDialog
saves time.The gtk.MessageDialog
types are listed in the .A selection of predefined button sets is available for use in a
message dialog. See the .See the gtk.Dialog reference
page for additional methods to be used with the gtk.MessageDialog.Constructorgtk.MessageDialogparentNoneflags0typegtk.MESSAGE_INFObuttonsgtk.BUTTONS_NONEmessage_formatNoneparent :the transient parent, or None if
noneflags :the dialog flags - a combination of:
gtk.DIALOG_MODAL,
gtk.DIALOG_DESTROY_WITH_PARENT or 0 for no
flagstype :the type of message:
gtk.MESSAGE_INFO, gtk.MESSAGE_WARNING,
gtk.MESSAGE_QUESTION or
gtk.MESSAGE_ERROR.buttons :the predefined set of buttons to use:
gtk.BUTTONS_NONE, gtk.BUTTONS_OK,
gtk.BUTTONS_CLOSE, gtk.BUTTONS_CANCEL,
gtk.BUTTONS_YES_NO,
gtk.BUTTONS_OK_CANCELmessage_format :a string containing the message text or
NoneReturns :a new gtk.MessageDialog
widgetCreates a new gtk.MessageDialog,
which is a simple dialog with an icon indicating the dialog type (error,
warning, etc.) specified by type and some text
(message_format) the user may want to see.
parent if specified indicates the transient parent of
the dialog. The flags allow the specification special
dialog characteristics: make the dialog modal
(gtk.DIALOG_MODAL) and destroy the dialog when the parent is
destroyed (gtk.DIALOG_DESTROY_WITH_PARENT). When the user
clicks a button a "response" signal is emitted with response IDs.
buttons specifies the set of predefined buttons to
use: gtk.BUTTONS_NONE, gtk.BUTTONS_OK,
gtk.BUTTONS_CLOSE, gtk.BUTTONS_CANCEL,
gtk.BUTTONS_YES_NO,
gtk.BUTTONS_OK_CANCEL. See gtk.Dialog for more
details.Methodsgtk.MessageDialog.set_markupset_markupstrstr :a markup string (see the Pango markup language
reference)This method is available in PyGTK 2.4 and above.The set_markup() method sets the text
of the message dialog to the contents of str. If
str contains text marked up with Pango markup (see
), it will be displayed with
those attributes. Note the '<', '>' and '&' characters must be
replaced with '<', '>' and '&' respectively to be
displayed literally.gtk.MessageDialog.format_secondary_textformat_secondary_textmessage_formatmessage_format :The text to be displayed as the secondary text
or None.This method is available in PyGTK 2.6 and above.The format_secondary_text() method sets
the secondary text of the message dialog to the text specified by
message_format. Note that setting a secondary text
makes the primary text bold, unless you have provided explicit
markup.gtk.MessageDialog.format_secondary_markupformat_secondary_markupmessage_formatmessage_format :A string containing the pango markup to use as
secondary text.This method is available in PyGTK 2.6 and above.The format_secondary_markup() method
sets the secondary text to the markup text specified by
message_format. Note that setting a secondary text
makes the primary text become bold, unless you have provided explicit
markup.gtk.MessageDialog.set_imageset_imageimageimage :the image widgetThis method is available in PyGTK 2.10 and above.The set_image() method sets the
dialog's image to the gtk.Widget
specified by image.gtk.MessageDialog.get_imageget_imageReturns :the dialog's image.This method is available in PyGTK 2.14 and above.
The get_image() method gets the dialog's image.
gtk.MessageDialog.get_message_areaget_message_areaReturns :A gtk.VBox corresponding to the "message area" in the message_dialog.This method is available in PyGTK 2.22 and above.The get_message_area() method returns the message area of the dialog.
This is the box where the dialog's primary and secondary labels are packed. You can add your own
extra content to that box and it will appear below those labels, on the right side of the dialog's
image (or on the left for right-to-left languages). See
get_content_area
for the corresponding function in the parent
gtk.Dialog.