[gtk+/gtk-2-90: 178/200] Replace GtkFileSelection with GtkFileChooser in testgtk



commit eaf3ccfba058b9fc6163de95bfec5ca3912231b1
Author: Christian Dywan <christian twotoasts de>
Date:   Tue Apr 6 17:22:18 2010 +0200

    Replace GtkFileSelection with GtkFileChooser in testgtk

 tests/testgtk.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 88c6ef1..dc65301 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -4228,27 +4228,21 @@ cmw_file (GtkWidget *widget, GtkWidget *parent)
 {
     GtkWidget *fs;
 
-    fs = gtk_file_selection_new("This is a modal file selection dialog");
-
+    fs = gtk_file_chooser_dialog_new ("This is a modal file selection dialog",
+      GTK_WINDOW (parent), GTK_FILE_CHOOSER_ACTION_OPEN,
+      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+      NULL);
     gtk_window_set_screen (GTK_WINDOW (fs), gtk_widget_get_screen (parent));
-
-    /* Set as modal */
-    gtk_window_set_modal (GTK_WINDOW(fs),TRUE);
-
-    /* And mark it as a transient dialog */
-    gtk_window_set_transient_for (GTK_WINDOW (fs), GTK_WINDOW (parent));
+    gtk_window_set_modal (GTK_WINDOW (fs), TRUE);
 
     g_signal_connect (fs, "destroy",
                       G_CALLBACK (cmw_destroy_cb), NULL);
+    g_signal_connect_swapped (fs, "response",
+                      G_CALLBACK (gtk_widget_destroy), fs);
 
-    g_signal_connect_swapped (GTK_FILE_SELECTION (fs)->ok_button,
-			      "clicked", G_CALLBACK (gtk_widget_destroy), fs);
-    g_signal_connect_swapped (GTK_FILE_SELECTION (fs)->cancel_button,
-			      "clicked", G_CALLBACK (gtk_widget_destroy), fs);
-    
     /* wait until destroy calls gtk_main_quit */
     gtk_widget_show (fs);
-    
     gtk_main();
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]