summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Main <imain@gnu.org>1998-03-06 05:03:15 +0000
committerIan Main <imain@src.gnome.org>1998-03-06 05:03:15 +0000
commit2a4c36a73d3a12466bfebdc4dca1b8f31bd8695b (patch)
tree87837d9b114d5ed7a70dbd1170a7f09c1f526321 /tests
parent4a35f24c470096c2d4edd9bfd95acab4efd60709 (diff)
downloadgtk+-2a4c36a73d3a12466bfebdc4dca1b8f31bd8695b.tar.gz
Added gtk_file_selection_show_fileop_buttons(GtkFileSelection *fs), and
Thu Mar 5 20:41:27 1998 Ian Main <imain@gnu.org> * gtk/gtkfilesel.c: Added gtk_file_selection_show_fileop_buttons(GtkFileSelection *fs), and gtk_file_selection_hide_fileop_buttons(GtkFileSelection *fs). Changed pulldown to only contain current directory name instead of the full path. Removed Help button (it can now be packed into the button_area if desired. * gtk/gtkfilesel.h: Added GtkWidget *button_area (the fileop buttons at the top are packed into this hbox), and GtkWidget action_area (hbox below clists) to GtkFileSelection structure. * gtk/testgtk.c: Changed the filesel example to show off the hiding/ showing of fileop buttons, and the packing area.
Diffstat (limited to 'tests')
-rw-r--r--tests/testgtk.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 9ed009eea9..f8068bee5a 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -2985,6 +2985,12 @@ create_color_selection ()
gtk_widget_destroy (window);
}
+void
+file_selection_hide_fileops (GtkWidget *widget,
+ GtkFileSelection *fs)
+{
+ gtk_file_selection_hide_fileop_buttons (fs);
+}
void
file_selection_ok (GtkWidget *w,
@@ -2998,10 +3004,14 @@ void
create_file_selection ()
{
static GtkWidget *window = NULL;
+ GtkWidget *button;
if (!window)
{
window = gtk_file_selection_new ("file selection dialog");
+
+ gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (window));
+
gtk_window_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
@@ -3017,8 +3027,27 @@ create_file_selection ()
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (window)->cancel_button),
"clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT (window));
- }
+
+ button = gtk_button_new_with_label ("Hide Fileops");
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ (GtkSignalFunc) file_selection_hide_fileops,
+ (gpointer) window);
+ gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (window)->action_area),
+ button, FALSE, FALSE, 0);
+ gtk_widget_show (button);
+
+ button = gtk_button_new_with_label ("Show Fileops");
+ gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
+ (GtkSignalFunc) gtk_file_selection_show_fileop_buttons,
+ (gpointer) window);
+ gtk_box_pack_start (GTK_BOX (GTK_FILE_SELECTION (window)->action_area),
+ button, FALSE, FALSE, 0);
+ gtk_widget_show (button);
+
+
+ }
+
if (!GTK_WIDGET_VISIBLE (window))
gtk_widget_show (window);
else