emacs-devel
[Top][All Lists]
Advanced

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

Re: GTK file selector


From: Pierre-Charles David
Subject: Re: GTK file selector
Date: Fri, 16 Dec 2005 19:53:23 +0100

> These sound like reasonable features.  What is missing is something
> to give the user a clue to them.

The Gtk+ file chooser supports the addition of arbitrary widgets, which
are shown below the file list. One could use a toggle button to make the
"Show hidden files" feature visible:

toggle = gtk_check_button_new_with_label ("Show hidden files.");
gtk_widget_show (toggle);
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (dialog),
                                   toggle);
g_signal_connect (G_OBJECT (toggle_button), "clicked",
                  G_CALLBACK (toggle_visibility), G_OBJECT(dialog));

with:

static void toggle_visibility(GtkWidget *widget, gpointer data)
{
  GtkFileChooser *dialog = GTK_FILE_CHOOSER(data);
  gboolean visible = ! gtk_file_chooser_get_show_hidden(dialog);
  gtk_file_chooser_set_show_hidden(dialog, visible);
}

The default visibility state could also be exposed as an Emacs
configuration variable.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]