.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Gtk2::MessageDialog 3" .TH Gtk2::MessageDialog 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Gtk2::MessageDialog \- wrapper for GtkMessageDialog .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 10 \& # \& # A modal dialog. Note that the message is a printf\-style format. \& # \& $dialog = Gtk2::MessageDialog\->new ($main_application_window, \& \*(Aqdestroy\-with\-parent\*(Aq, \& \*(Aqquestion\*(Aq, # message type \& \*(Aqyes\-no\*(Aq, # which set of buttons? \& "Pay me $%.2f?", $amount); \& $response = $dialog\->run; \& if ($response eq \*(Aqyes\*(Aq) { \& send_bill (); \& } \& $dialog\->destroy; \& \& # \& # A non\-modal dialog. \& # \& $dialog = Gtk2::MessageDialog\->new ($main_application_window, \& \*(Aqdestroy\-with\-parent\*(Aq, \& \*(Aqquestion\*(Aq, # message type \& \*(Aqok\-cancel\*(Aq, # which set of buttons? \& "Self\-destruct now?"); \& # react whenever the user responds. \& $dialog\->signal_connect (response => sub { \& my ($self, $response) = @_; \& if ($response eq \*(Aqok\*(Aq) { \& do_the_thing (); \& } \& $self\->destroy; \& }); \& $dialog\->show_all; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Gtk2::MessageDialog is 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 Gtk2::MessageDialog from Gtk2::Dialog without too much effort, but Gtk2::MessageDialog saves typing and helps create a consistent look and feel for your application. .PP The easiest way to do a modal message dialog is to use \f(CW\*(C`$dialog\->run\*(C'\fR, which automatically makes your dialog modal and waits for the user to respond to it. You can also pass in the GTK_DIALOG_MODAL flag when creating the MessageDialog. .SH HIERARCHY .IX Header "HIERARCHY" .Vb 9 \& Glib::Object \& +\-\-\-\-Glib::InitiallyUnowned \& +\-\-\-\-Gtk2::Object \& +\-\-\-\-Gtk2::Widget \& +\-\-\-\-Gtk2::Container \& +\-\-\-\-Gtk2::Bin \& +\-\-\-\-Gtk2::Window \& +\-\-\-\-Gtk2::Dialog \& +\-\-\-\-Gtk2::MessageDialog .Ve .SH INTERFACES .IX Header "INTERFACES" .Vb 2 \& Glib::Object::_Unregistered::AtkImplementorIface \& Gtk2::Buildable .Ve .SH METHODS .IX Header "METHODS" .ie n .SS "widget = Gtk2::MessageDialog\->\fBnew\fP ($parent, $flags, $type, $buttons, $format, ...)" .el .SS "widget = Gtk2::MessageDialog\->\fBnew\fP ($parent, \f(CW$flags\fP, \f(CW$type\fP, \f(CW$buttons\fP, \f(CW$format\fP, ...)" .IX Subsection "widget = Gtk2::MessageDialog->new ($parent, $flags, $type, $buttons, $format, ...)" .IP \(bu 4 \&\f(CW$parent\fR (Gtk2::Window or undef) .IP \(bu 4 \&\f(CW$flags\fR (Gtk2::DialogFlags) .IP \(bu 4 \&\f(CW$type\fR (Gtk2::MessageType) .IP \(bu 4 \&\f(CW$buttons\fR (Gtk2::ButtonsType) .IP \(bu 4 \&\f(CW$format\fR (scalar) .IP \(bu 4 \&... (list) .ie n .SS "widget = Gtk2::MessageDialog\->\fBnew_with_markup\fP ($parent, $flags, $type, $buttons, $message)" .el .SS "widget = Gtk2::MessageDialog\->\fBnew_with_markup\fP ($parent, \f(CW$flags\fP, \f(CW$type\fP, \f(CW$buttons\fP, \f(CW$message\fP)" .IX Subsection "widget = Gtk2::MessageDialog->new_with_markup ($parent, $flags, $type, $buttons, $message)" .IP \(bu 4 \&\f(CW$parent\fR (Gtk2::Window or undef) .IP \(bu 4 \&\f(CW$flags\fR (Gtk2::DialogFlags) .IP \(bu 4 \&\f(CW$type\fR (Gtk2::MessageType) .IP \(bu 4 \&\f(CW$buttons\fR (Gtk2::ButtonsType) .IP \(bu 4 \&\f(CW$message\fR (string or undef) a string containing Pango markup .PP Like \f(CW\*(C`new\*(C'\fR, but allowing Pango markup tags in the message. Note that this version is not variadic. .PP Since: gtk+ 2.4 .ie n .SS "$message_dialog\->\fBformat_secondary_markup\fP ($message_format, ...)" .el .SS "\f(CW$message_dialog\fP\->\fBformat_secondary_markup\fP ($message_format, ...)" .IX Subsection "$message_dialog->format_secondary_markup ($message_format, ...)" .IP \(bu 4 \&\f(CW$message_format\fR (scalar) .IP \(bu 4 \&... (list) .PP Since: gtk+ 2.6 .ie n .SS "$message_dialog\->\fBformat_secondary_text\fP ($message_format, ...)" .el .SS "\f(CW$message_dialog\fP\->\fBformat_secondary_text\fP ($message_format, ...)" .IX Subsection "$message_dialog->format_secondary_text ($message_format, ...)" .IP \(bu 4 \&\f(CW$message_format\fR (scalar) .IP \(bu 4 \&... (list) .PP Since: gtk+ 2.6 .ie n .SS "widget = $dialog\->\fBget_image\fP" .el .SS "widget = \f(CW$dialog\fP\->\fBget_image\fP" .IX Subsection "widget = $dialog->get_image" Since: gtk+ 2.14 .ie n .SS "$dialog\->\fBset_image\fP ($image)" .el .SS "\f(CW$dialog\fP\->\fBset_image\fP ($image)" .IX Subsection "$dialog->set_image ($image)" .IP \(bu 4 \&\f(CW$image\fR (Gtk2::Widget) .PP Since: gtk+ 2.10 .ie n .SS "$message_dialog\->\fBset_markup\fP ($str)" .el .SS "\f(CW$message_dialog\fP\->\fBset_markup\fP ($str)" .IX Subsection "$message_dialog->set_markup ($str)" .IP \(bu 4 \&\f(CW$str\fR (string) .PP Since: gtk+ 2.4 .ie n .SS "widget = $message_dialog\->\fBget_message_area\fP" .el .SS "widget = \f(CW$message_dialog\fP\->\fBget_message_area\fP" .IX Subsection "widget = $message_dialog->get_message_area" Since: gtk+ 2.22 .SH PROPERTIES .IX Header "PROPERTIES" .IP "'buttons' (Gtk2::ButtonsType : default ""none"" : writable / construct-only / private / static-nick / static-blurb)" 4 .IX Item "'buttons' (Gtk2::ButtonsType : default ""none"" : writable / construct-only / private / static-nick / static-blurb)" The buttons shown in the message dialog .IP "'image' (Gtk2::Widget : default undef : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'image' (Gtk2::Widget : default undef : readable / writable / private / static-nick / static-blurb)" The image .IP "'message\-area' (Gtk2::Widget : default undef : readable / private / static-nick / static-blurb)" 4 .IX Item "'message-area' (Gtk2::Widget : default undef : readable / private / static-nick / static-blurb)" GtkVBox that holds the dialog's primary and secondary labels .IP "'message\-type' (Gtk2::MessageType : default ""info"" : readable / writable / construct / private / static-nick / static-blurb)" 4 .IX Item "'message-type' (Gtk2::MessageType : default ""info"" : readable / writable / construct / private / static-nick / static-blurb)" The type of message .IP "'secondary\-text' (string : default undef : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'secondary-text' (string : default undef : readable / writable / private / static-nick / static-blurb)" The secondary text of the message dialog .IP "'secondary\-use\-markup' (boolean : default false : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'secondary-use-markup' (boolean : default false : readable / writable / private / static-nick / static-blurb)" The secondary text includes Pango markup. .IP "'text' (string : default """" : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'text' (string : default """" : readable / writable / private / static-nick / static-blurb)" The primary text of the message dialog .IP "'use\-markup' (boolean : default false : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'use-markup' (boolean : default false : readable / writable / private / static-nick / static-blurb)" The primary text of the title includes Pango markup. .SH "STYLE PROPERTIES" .IX Header "STYLE PROPERTIES" .IP "'message\-border' (integer : default 12 : readable / private / static-nick / static-blurb)" 4 .IX Item "'message-border' (integer : default 12 : readable / private / static-nick / static-blurb)" Width of border around the label and image in the message dialog .IP "'use\-separator' (boolean : default false : readable / private / static-nick / static-blurb)" 4 .IX Item "'use-separator' (boolean : default false : readable / private / static-nick / static-blurb)" Whether to put a separator between the message dialog's text and the buttons .SH "ENUMS AND FLAGS" .IX Header "ENUMS AND FLAGS" .SS "enum Gtk2::ButtonsType" .IX Subsection "enum Gtk2::ButtonsType" .IP \(bu 4 \&'none' / 'GTK_BUTTONS_NONE' .IP \(bu 4 \&'ok' / 'GTK_BUTTONS_OK' .IP \(bu 4 \&'close' / 'GTK_BUTTONS_CLOSE' .IP \(bu 4 \&'cancel' / 'GTK_BUTTONS_CANCEL' .IP \(bu 4 \&'yes\-no' / 'GTK_BUTTONS_YES_NO' .IP \(bu 4 \&'ok\-cancel' / 'GTK_BUTTONS_OK_CANCEL' .SS "flags Gtk2::DialogFlags" .IX Subsection "flags Gtk2::DialogFlags" .IP \(bu 4 \&'modal' / 'GTK_DIALOG_MODAL' .IP \(bu 4 \&'destroy\-with\-parent' / 'GTK_DIALOG_DESTROY_WITH_PARENT' .IP \(bu 4 \&'no\-separator' / 'GTK_DIALOG_NO_SEPARATOR' .SS "enum Gtk2::MessageType" .IX Subsection "enum Gtk2::MessageType" .IP \(bu 4 \&'info' / 'GTK_MESSAGE_INFO' .IP \(bu 4 \&'warning' / 'GTK_MESSAGE_WARNING' .IP \(bu 4 \&'question' / 'GTK_MESSAGE_QUESTION' .IP \(bu 4 \&'error' / 'GTK_MESSAGE_ERROR' .IP \(bu 4 \&'other' / 'GTK_MESSAGE_OTHER' .SH "SEE ALSO" .IX Header "SEE ALSO" Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::Window, Gtk2::Dialog .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2003\-2011 by the gtk2\-perl team. .PP This software is licensed under the LGPL. See Gtk2 for a full notice.