]> Pileus Git - ~andy/gtk/commitdiff
GtkFontChooserDialog: Add parent window as a parameter in the constructor
authorAlberto Ruiz <aruiz@gnome.org>
Mon, 25 Jul 2011 16:14:49 +0000 (17:14 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 15 Aug 2011 22:57:56 +0000 (18:57 -0400)
gtk/gtkfontchooserdialog.c
gtk/gtkfontchooserdialog.h
tests/testfontchooserdialog.c

index 08c529f8dd5bece4b0e1389413d21f94c2b5379a..6d90e159d63593a7007ec8276cbab94edb3d4b86 100644 (file)
@@ -140,7 +140,8 @@ gtk_font_chooser_dialog_init (GtkFontChooserDialog *fontchooserdiag)
 
 /**
  * gtk_font_chooser_dialog_new:
- * @title: (allow-none): the title of the dialog window 
+ * @title: (allow-none): Title of the dialog, or %NULL
+ * @parent: (allow-none): Trasient parent of the dialog, or %NULL
  *
  * Creates a new #GtkFontChooserDialog.
  *
@@ -149,11 +150,15 @@ gtk_font_chooser_dialog_init (GtkFontChooserDialog *fontchooserdiag)
  * Since: 3.2
  */
 GtkWidget*
-gtk_font_chooser_dialog_new (const gchar *title)
+gtk_font_chooser_dialog_new (const gchar *title,
+                             GtkWindow   *parent)
 {
   GtkFontChooserDialog *dialog;
 
-  dialog = g_object_new (GTK_TYPE_FONT_CHOOSER_DIALOG, "title", title, NULL);
+  dialog = g_object_new (GTK_TYPE_FONT_CHOOSER_DIALOG,
+                         "title", title,
+                         "transient-for", parent,
+                         NULL);
 
   return GTK_WIDGET (dialog);
 }
index 5a7b3d003255c47b612545011407c3b455d462b9..b127f66b2d50cd3781cdcc98ad4e1b167861bc2d 100644 (file)
@@ -59,7 +59,8 @@ struct _GtkFontChooserDialogClass
 };
 
 GType       gtk_font_chooser_dialog_get_type           (void) G_GNUC_CONST;
-GtkWidget* gtk_font_chooser_dialog_new               (const gchar            *title);
+GtkWidget* gtk_font_chooser_dialog_new               (const gchar          *title,
+                                                       GtkWindow            *window);
 
 GtkWidget* gtk_font_chooser_dialog_get_font_chooser   (GtkFontChooserDialog *fcd);
 
index b06ddb59f4e5efa7aa73d7a84204205472dedb06..d2426985907874338dfd7e2620257350be8f1210 100644 (file)
@@ -28,7 +28,7 @@ main (int argc, char *argv[])
 
   gtk_init (&argc, &argv);
 
-  dialog = gtk_font_chooser_dialog_new (NULL);
+  dialog = gtk_font_chooser_dialog_new (NULL, NULL);
 
   gtk_dialog_run (GTK_DIALOG (dialog));