Description Methods and Functions Hierarchy Interfaces Detailed Description Structures Convenient Construction Enums and Flags Properties Style Properties Author(s) References See Also
A convenient message window
gtkMessageDialogNew(parent = NULL, flags, type, buttons, ..., show = TRUE)
gtkMessageDialogNewWithMarkup(parent, flags, type, buttons, ..., show = TRUE)
gtkMessageDialogSetMarkup(object, str)
gtkMessageDialogSetImage(object, image)
gtkMessageDialogGetImage(object)
gtkMessageDialogFormatSecondaryText(object, ...)
gtkMessageDialogFormatSecondaryMarkup(object, ...)
gtkMessageDialog(parent, flags, type, buttons, ..., show = TRUE)
1 2 3 4 5 6 7 8 9 | GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBin
+----GtkWindow
+----GtkDialog
+----GtkMessageDialog
|
GtkMessageDialog implements
AtkImplementorIface and GtkBuildable
.
GtkMessageDialog
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 GtkMessageDialog
from GtkDialog
without too much effort, but GtkMessageDialog
saves typing.
The easiest way to do a modal message dialog is to use gtkDialogRun
, though
you can also pass in the GTK_DIALOG_MODAL
flag, gtkDialogRun
automatically
makes the dialog modal and waits for the user to respond to it. gtkDialogRun
returns when any dialog button is clicked.
A modal dialog.
1 2 3 4 5 6 | # A Modal dialog
dialog <- gtkMessageDialog(main_application_window, "destroy-with-parent",
"error", "close", "Error loading file '", filename,
"': ", message)
dialog$run()
dialog$destroy()
|
You might do a non-modal GtkMessageDialog
as follows:
A non-modal dialog.
1 2 3 4 5 | dialog <- gtkMessageDialog(main_application_window, "destroy-with-parent",
"error", "close", "Error loading file '", filename,
"': ", message)
# Destroy the dialog when the user responds to it (e.g. clicks a button)
gSignalConnect(dialog, "response", gtkWidgetDestroy)
|
GtkMessageDialog
undocumented
image
[GtkWidget
]
label
[GtkWidget
]
gtkMessageDialog
is the result of collapsing the constructors of GtkMessageDialog
(gtkMessageDialogNew
, gtkMessageDialogNewWithMarkup
) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.
GtkMessageType
The type of message being displayed in the dialog.
info
Informational message
warning
Nonfatal warning message
question
Question requiring a choice
error
Fatal error message
GtkButtonsType
Prebuilt sets of buttons for the dialog. If
none of these choices are appropriate, simply use GTK_BUTTONS_NONE
then call gtkDialogAddButtons
.
none
no buttons at all
ok
an OK button
close
a Close button
cancel
a Cancel button
yes-no
Yes and No buttons
ok-cancel
OK and Cancel buttons
buttons
[GtkButtonsType
: Write / Construct Only]The buttons shown in the message dialog. Default value: GTK_BUTTONS_NONE
image
[GtkWidget
: * : Read / Write]The image for this dialog. Since 2.10
message-type
[GtkMessageType
: Read / Write / Construct]The type of the message. The type is used to determine the image that is shown in the dialog, unless the image is explicitly set by the ::image property. Default value: GTK_MESSAGE_INFO
secondary-text
[character : * : Read / Write]The secondary text of the message dialog. Default value: NULL Since 2.10
secondary-use-markup
[logical : Read / Write]TRUE
if the secondary text of the dialog includes Pango markup.
See pangoParseMarkup
.
Default value: FALSE Since 2.10
text
[character : * : Read / Write]The primary text of the message dialog. If the dialog has a secondary text, this will appear as the title. Default value: "" Since 2.10
use-markup
[logical : Read / Write]TRUE
if the primary text of the dialog includes Pango markup.
See pangoParseMarkup
.
Default value: FALSE Since 2.10
message-border
[integer : Read]Width of border around the label and image in the message dialog. Allowed values: >= 0 Default value: 12
use-separator
[logical : Read]Whether to draw a separator line between the message label and the buttons in the dialog. Default value: FALSE Since 2.4
Derived by RGtkGen from GTK+ documentation
https://developer.gnome.org/gtk2/stable/GtkMessageDialog.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.