Commit 0adb1b26 authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

redid the filesel test. Added a way to set select multiple as a toggle

2002-02-16  Manish Singh  <yosh@gimp.org>

        * tests/testgtk.c: redid the filesel test. Added a way to set select
        multiple as a toggle button, and made show/hide fileops toggle
        buttons as well. get_selections() is called on OK and all the
        filenames selected are printed.
parent efbdfddb
2002-02-16 Manish Singh <yosh@gimp.org>
* tests/testgtk.c: redid the filesel test. Added a way to set select
multiple as a toggle button, and made show/hide fileops toggle
buttons as well. get_selections() is called on OK and all the
filenames selected are printed.
2002-02-17 Tor Lillqvist <tml@iki.fi> 2002-02-17 Tor Lillqvist <tml@iki.fi>
* README.win32: Remove comment about the gtk-1-3-win32-production * README.win32: Remove comment about the gtk-1-3-win32-production
......
2002-02-16 Manish Singh <yosh@gimp.org>
* tests/testgtk.c: redid the filesel test. Added a way to set select
multiple as a toggle button, and made show/hide fileops toggle
buttons as well. get_selections() is called on OK and all the
filenames selected are printed.
2002-02-17 Tor Lillqvist <tml@iki.fi> 2002-02-17 Tor Lillqvist <tml@iki.fi>
* README.win32: Remove comment about the gtk-1-3-win32-production * README.win32: Remove comment about the gtk-1-3-win32-production
......
2002-02-16 Manish Singh <yosh@gimp.org>
* tests/testgtk.c: redid the filesel test. Added a way to set select
multiple as a toggle button, and made show/hide fileops toggle
buttons as well. get_selections() is called on OK and all the
filenames selected are printed.
2002-02-17 Tor Lillqvist <tml@iki.fi> 2002-02-17 Tor Lillqvist <tml@iki.fi>
* README.win32: Remove comment about the gtk-1-3-win32-production * README.win32: Remove comment about the gtk-1-3-win32-production
......
2002-02-16 Manish Singh <yosh@gimp.org>
* tests/testgtk.c: redid the filesel test. Added a way to set select
multiple as a toggle button, and made show/hide fileops toggle
buttons as well. get_selections() is called on OK and all the
filenames selected are printed.
2002-02-17 Tor Lillqvist <tml@iki.fi> 2002-02-17 Tor Lillqvist <tml@iki.fi>
* README.win32: Remove comment about the gtk-1-3-win32-production * README.win32: Remove comment about the gtk-1-3-win32-production
......
2002-02-16 Manish Singh <yosh@gimp.org>
* tests/testgtk.c: redid the filesel test. Added a way to set select
multiple as a toggle button, and made show/hide fileops toggle
buttons as well. get_selections() is called on OK and all the
filenames selected are printed.
2002-02-17 Tor Lillqvist <tml@iki.fi> 2002-02-17 Tor Lillqvist <tml@iki.fi>
* README.win32: Remove comment about the gtk-1-3-win32-production * README.win32: Remove comment about the gtk-1-3-win32-production
......
2002-02-16 Manish Singh <yosh@gimp.org>
* tests/testgtk.c: redid the filesel test. Added a way to set select
multiple as a toggle button, and made show/hide fileops toggle
buttons as well. get_selections() is called on OK and all the
filenames selected are printed.
2002-02-17 Tor Lillqvist <tml@iki.fi> 2002-02-17 Tor Lillqvist <tml@iki.fi>
* README.win32: Remove comment about the gtk-1-3-win32-production * README.win32: Remove comment about the gtk-1-3-win32-production
......
2002-02-16 Manish Singh <yosh@gimp.org>
* tests/testgtk.c: redid the filesel test. Added a way to set select
multiple as a toggle button, and made show/hide fileops toggle
buttons as well. get_selections() is called on OK and all the
filenames selected are printed.
2002-02-17 Tor Lillqvist <tml@iki.fi> 2002-02-17 Tor Lillqvist <tml@iki.fi>
* README.win32: Remove comment about the gtk-1-3-win32-production * README.win32: Remove comment about the gtk-1-3-win32-production
......
...@@ -6467,17 +6467,42 @@ create_color_selection (void) ...@@ -6467,17 +6467,42 @@ create_color_selection (void)
*/ */
void void
file_selection_hide_fileops (GtkWidget *widget, show_fileops (GtkWidget *widget,
GtkFileSelection *fs) GtkFileSelection *fs)
{ {
gtk_file_selection_hide_fileop_buttons (fs); gboolean show_ops;
show_ops = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
if (show_ops)
gtk_file_selection_show_fileop_buttons (fs);
else
gtk_file_selection_hide_fileop_buttons (fs);
} }
void void
file_selection_ok (GtkWidget *w, select_multiple (GtkWidget *widget,
GtkFileSelection *fs) GtkFileSelection *fs)
{ {
g_print ("%s\n", gtk_file_selection_get_filename (fs)); gboolean select_multiple;
select_multiple = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
gtk_file_selection_set_select_multiple (fs, select_multiple);
}
void
file_selection_ok (GtkFileSelection *fs)
{
int i;
gchar **selections;
selections = gtk_file_selection_get_selections (fs);
for (i = 0; selections[i] != NULL; i++)
g_print ("%s\n", selections[i]);
g_strfreev (selections);
gtk_widget_destroy (GTK_WIDGET (fs)); gtk_widget_destroy (GTK_WIDGET (fs));
} }
...@@ -6495,29 +6520,31 @@ create_file_selection (void) ...@@ -6495,29 +6520,31 @@ create_file_selection (void)
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE); gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy", g_signal_connect (window, "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed), G_CALLBACK (gtk_widget_destroyed),
&window); &window);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (window)->ok_button), g_signal_connect_swapped (GTK_FILE_SELECTION (window)->ok_button,
"clicked", GTK_SIGNAL_FUNC(file_selection_ok), "clicked",
window); G_CALLBACK (file_selection_ok),
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (window)->cancel_button), window);
"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), g_signal_connect_swapped (GTK_FILE_SELECTION (window)->cancel_button,
GTK_OBJECT (window)); "clicked",
G_CALLBACK (gtk_widget_destroy),
button = gtk_button_new_with_label ("Hide Fileops"); window);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) file_selection_hide_fileops, button = gtk_toggle_button_new_with_label ("Show Fileops");
(gpointer) window); g_signal_connect (button, "toggled",
G_CALLBACK (show_fileops),
window);
gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (window)->action_area), gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (window)->action_area),
button, FALSE, FALSE, 0); button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
button = gtk_button_new_with_label ("Show Fileops"); button = gtk_toggle_button_new_with_label ("Select Multiple");
gtk_signal_connect_object (GTK_OBJECT (button), "clicked", g_signal_connect (button, "clicked",
(GtkSignalFunc) gtk_file_selection_show_fileop_buttons, G_CALLBACK (select_multiple),
(gpointer) window); window);
gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (window)->action_area), gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (window)->action_area),
button, FALSE, FALSE, 0); button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment