? docs/tutorial/gtk-tut.pdf
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.4105
diff -u -r1.4105 ChangeLog
--- ChangeLog	29 Mar 2003 00:48:28 -0000	1.4105
+++ ChangeLog	29 Mar 2003 04:40:41 -0000
@@ -1,3 +1,12 @@
+2003-03-29  Sebastian Rittau  <srittau@jroger.in-berlin.de>
+
+	* gtk/gtkmessagedialog.h:
+	* gtk/gtkmessagedialog.c (gtk_message_dialog_new_with_markup): New
+	method.
+
+	* docs/reference/gtk/gtk-sections.txt: Added
+	gtk_message_dialog_new_with_markup().
+
 2003-03-29  Matthias Clasen  <maclas@gmx.de>
 
 	* gtk/gtkoptionmenu.c (gtk_option_menu_remove_contents): Set state
Index: docs/reference/gtk/gtk-sections.txt
===================================================================
RCS file: /cvs/gnome/gtk+/docs/reference/gtk/gtk-sections.txt,v
retrieving revision 1.71
diff -u -r1.71 gtk-sections.txt
--- docs/reference/gtk/gtk-sections.txt	14 Jan 2003 01:07:58 -0000	1.71
+++ docs/reference/gtk/gtk-sections.txt	29 Mar 2003 04:40:42 -0000
@@ -1601,6 +1601,7 @@
 GtkMessageType
 GtkButtonsType
 gtk_message_dialog_new
+gtk_message_dialog_new_with_markup
 <SUBSECTION Standard>
 GTK_MESSAGE_DIALOG
 GTK_IS_MESSAGE_DIALOG
Index: docs/reference/gtk/tmpl/gtkmessagedialog.sgml
===================================================================
RCS file: /cvs/gnome/gtk+/docs/reference/gtk/tmpl/gtkmessagedialog.sgml,v
retrieving revision 1.7
diff -u -r1.7 gtkmessagedialog.sgml
--- docs/reference/gtk/tmpl/gtkmessagedialog.sgml	2 Nov 2002 18:18:49 -0000	1.7
+++ docs/reference/gtk/tmpl/gtkmessagedialog.sgml	29 Mar 2003 04:40:42 -0000
@@ -102,6 +102,20 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gtk_message_dialog_new_with_markup ##### -->
+<para>
+
+</para>
+
+@parent: 
+@flags: 
+@type: 
+@buttons: 
+@message_format: 
+@Varargs: 
+@Returns: 
+
+
 <!-- ##### ARG GtkMessageDialog:buttons ##### -->
 <para>
 
Index: gtk/gtkmessagedialog.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmessagedialog.c,v
retrieving revision 1.13
diff -u -r1.13 gtkmessagedialog.c
--- gtk/gtkmessagedialog.c	11 Oct 2002 22:57:11 -0000	1.13
+++ gtk/gtkmessagedialog.c	29 Mar 2003 04:40:43 -0000
@@ -18,7 +18,7 @@
  */
 
 /*
- * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
+ * Modified by the GTK+ Team and others 1997-2003.  See the AUTHORS
  * file for a list of people on the GTK+ Team.  See the ChangeLog
  * files for a list of changes.  These files are distributed with
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
@@ -302,7 +302,10 @@
   GtkDialog *dialog;
   gchar* msg = 0;
   va_list args;
-  
+
+  g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
+  g_return_val_if_fail (message_format != NULL, NULL);
+
   widget = g_object_new (GTK_TYPE_MESSAGE_DIALOG,
 			 "message_type", type,
 			 "buttons", buttons,
@@ -340,6 +343,77 @@
 
   if (flags & GTK_DIALOG_NO_SEPARATOR)
     gtk_dialog_set_has_separator (dialog, FALSE);
+
+  return widget;
+}
+
+/**
+ * gtk_message_dialog_new_with_markup:
+ * @parent: transient parent, or NULL for none 
+ * @flags: flags
+ * @type: type of message
+ * @buttons: set of buttons to use
+ * @message_format: printf()-style format string, or NULL
+ * @Varargs: arguments for @message_format
+ * 
+ * Creates a new message dialog, which is a simple dialog with an icon
+ * indicating the dialog type (error, warning, etc.) and some text which
+ * is marked up with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
+ * When the user clicks a button a "response" signal is emitted with
+ * response IDs from #GtkResponseType. See #GtkDialog for more details.
+ *
+ * Please note that if you have strings in the printf arguments
+ * passed to this function, you might need to protect against
+ * them being interpreted as markup. You can do this using
+ * g_markup_escape_text() as in the following example:
+ * <informalexample><programlisting>
+ *   const gchar *error_text =
+ *     "&lt;span weight=\"bold\" size=\"larger\"&gt;"
+ *     "Could not open document '%s'."
+ *     "&lt;/span&gt;\n\n"
+ *     "You do not have appropriate permission to access this file.";
+ *   gchar *tmp;
+ *   GtkWidget *dialog;
+ *   
+ *   tmp = g_markup_escape_text (filename, -1);
+ *   dialog = gtk_message_dialog_new_with_markup (main_application_window,
+ *                                                GTK_DIALOG_DESTROY_WITH_PARENT,
+ *                                                GTK_MESSAGE_ERROR,
+ *                                                GTK_BUTTONS_CLOSE,
+ *                                                error_text, tmp);
+ *   g_free (tmp);
+ * </programlisting></informalexample>
+ * 
+ * Return value: a new #GtkMessageDialog
+ **/
+GtkWidget*
+gtk_message_dialog_new_with_markup (GtkWindow     *parent,
+                                    GtkDialogFlags flags,
+                                    GtkMessageType type,
+                                    GtkButtonsType buttons,
+                                    const gchar   *message_format,
+                                    ...)
+{
+  GtkWidget *widget;
+  gchar* msg = 0;
+  va_list args;
+
+  g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL);
+  g_return_val_if_fail (message_format != NULL, NULL);
+
+  widget = gtk_message_dialog_new (parent, flags, type, buttons, "");
+
+  if (message_format)
+    {
+      va_start (args, message_format);
+      msg = g_strdup_vprintf(message_format, args);
+      va_end (args);
+
+      gtk_label_set_markup (GTK_LABEL (GTK_MESSAGE_DIALOG (widget)->label),
+                            msg);
+
+      g_free (msg);
+    }
 
   return widget;
 }
Index: gtk/gtkmessagedialog.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmessagedialog.h,v
retrieving revision 1.4
diff -u -r1.4 gtkmessagedialog.h
--- gtk/gtkmessagedialog.h	11 Oct 2002 22:57:11 -0000	1.4
+++ gtk/gtkmessagedialog.h	29 Mar 2003 04:40:43 -0000
@@ -18,7 +18,7 @@
  */
 
 /*
- * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
+ * Modified by the GTK+ Team and others 1997-2003.  See the AUTHORS
  * file for a list of people on the GTK+ Team.  See the ChangeLog
  * files for a list of changes.  These files are distributed with
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
@@ -91,6 +91,13 @@
                                         GtkButtonsType  buttons,
                                         const gchar    *message_format,
                                         ...) G_GNUC_PRINTF (5, 6);
+
+GtkWidget* gtk_message_dialog_new_with_markup   (GtkWindow      *parent,
+                                                 GtkDialogFlags  flags,
+                                                 GtkMessageType  type,
+                                                 GtkButtonsType  buttons,
+                                                 const gchar    *message_format,
+                                                 ...) G_GNUC_PRINTF (5, 6);
  
 
 
