diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-03-02 21:55:01 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-03-02 21:55:01 +0000 |
commit | ce52e0776ee98cfed42e565ca2a006bff5a1ce88 (patch) | |
tree | fedcc596a27e68f90e7721858084b2ad52a96bee /tests/testfilechooser.c | |
parent | d0f6b4819900f9af5e74cf7b55962d96e8645c2d (diff) | |
download | gtk+-ce52e0776ee98cfed42e565ca2a006bff5a1ce88.tar.gz |
Move the /nonexistant stuff out of the main window, keep the main window
Tue Mar 2 16:47:40 2004 Owen Taylor <otaylor@redhat.com>
* tests/testfilechooser.c (set_filename_existing_nonexistent_cb):
Move the /nonexistant stuff out of the main window,
keep the main window somewhat normal looking.
Diffstat (limited to 'tests/testfilechooser.c')
-rw-r--r-- | tests/testfilechooser.c | 65 |
1 files changed, 28 insertions, 37 deletions
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c index 3cccdc6779..d6f0a1cfb7 100644 --- a/tests/testfilechooser.c +++ b/tests/testfilechooser.c @@ -297,65 +297,33 @@ update_preview_cb (GtkFileChooser *chooser) } static void -set_folder_nonexistent_cb (GtkButton *button, +set_folder_nonexistent_cb (GtkButton *button, GtkFileChooser *chooser) { gtk_file_chooser_set_current_folder (chooser, "/nonexistent"); } static void -set_folder_existing_nonexistent_cb (GtkButton *button, +set_folder_existing_nonexistent_cb (GtkButton *button, GtkFileChooser *chooser) { gtk_file_chooser_set_current_folder (chooser, "/usr/nonexistent"); } static void -set_filename_nonexistent_cb (GtkButton *button, +set_filename_nonexistent_cb (GtkButton *button, GtkFileChooser *chooser) { gtk_file_chooser_set_filename (chooser, "/nonexistent"); } static void -set_filename_existing_nonexistent_cb (GtkButton *button, +set_filename_existing_nonexistent_cb (GtkButton *button, GtkFileChooser *chooser) { gtk_file_chooser_set_filename (chooser, "/usr/nonexistent"); } -static GtkWidget * -extra_widget_create (GtkFileChooser *chooser) -{ - GtkWidget *box; - GtkWidget *widget; - - box = gtk_vbox_new (FALSE, 6); - - widget = gtk_button_new_with_label ("set_current_folder (\"/nonexistent\")"); - g_signal_connect (widget, "clicked", - G_CALLBACK (set_folder_nonexistent_cb), chooser); - gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0); - - widget = gtk_button_new_with_label ("set_current_folder (\"/usr/nonexistent\""); - g_signal_connect (widget, "clicked", - G_CALLBACK (set_folder_existing_nonexistent_cb), chooser); - gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0); - - widget = gtk_button_new_with_label ("set_filename (\"/nonexistent\""); - g_signal_connect (widget, "clicked", - G_CALLBACK (set_filename_nonexistent_cb), chooser); - gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0); - - widget = gtk_button_new_with_label ("set_filename (\"/usr/nonexistent\""); - g_signal_connect (widget, "clicked", - G_CALLBACK (set_filename_existing_nonexistent_cb), chooser); - gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0); - - gtk_widget_show_all (box); - return box; -} - int main (int argc, char **argv) { @@ -364,6 +332,7 @@ main (int argc, char **argv) GtkWidget *button; GtkWidget *dialog; GtkWidget *prop_editor; + GtkWidget *extra; GtkFileFilter *filter; GtkWidget *preview_vbox; int i; @@ -457,7 +426,9 @@ main (int argc, char **argv) /* Extra widget */ - gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), extra_widget_create (GTK_FILE_CHOOSER (dialog))); + extra = gtk_check_button_new_with_mnemonic ("Lar_t whoever asks about this button"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (extra), TRUE); + gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog), extra); /* Shortcuts */ @@ -487,6 +458,26 @@ main (int argc, char **argv) g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_file_chooser_unselect_all), dialog); + button = gtk_button_new_with_label ("set_current_folder (\"/nonexistent\")"); + gtk_container_add (GTK_CONTAINER (vbbox), button); + g_signal_connect (button, "clicked", + G_CALLBACK (set_folder_nonexistent_cb), dialog); + + button = gtk_button_new_with_label ("set_current_folder (\"/usr/nonexistent\""); + gtk_container_add (GTK_CONTAINER (vbbox), button); + g_signal_connect (button, "clicked", + G_CALLBACK (set_folder_existing_nonexistent_cb), dialog); + + button = gtk_button_new_with_label ("set_filename (\"/nonexistent\""); + gtk_container_add (GTK_CONTAINER (vbbox), button); + g_signal_connect (button, "clicked", + G_CALLBACK (set_filename_nonexistent_cb), dialog); + + button = gtk_button_new_with_label ("set_filename (\"/usr/nonexistent\""); + gtk_container_add (GTK_CONTAINER (vbbox), button); + g_signal_connect (button, "clicked", + G_CALLBACK (set_filename_existing_nonexistent_cb), dialog); + gtk_widget_show_all (control_window); gtk_main (); |