Sign up now! · Forgot password?
RSS/Atom feed Twitter

Script-fu SF-FILENAME don't show the default setting

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

1 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

1188343063.5032.31.camel@ho... 07 Oct 20:18
  Script-fu SF-FILENAME don't show the default setting Pere Pujal i Carabantes 04 Sep 00:02
Pere Pujal i Carabantes
2007-09-04 00:02:05 UTC (over 14 years ago)

Script-fu SF-FILENAME don't show the default setting

On Wed, 2007-08-29 at 01:17 +0200, Pere Pujal i Carabantes wrote:

When using SF-FILENAME, if the file exist, the name of the file is shown
in the button, but if the file does not exist, ie. has to be created, there is "(none)" in the button.

Is there a way to show the name on the button even if the file does not
exist?

After some try/error and a look at the code, it seems not.

SF-Filename uses gtk_file_chooser_button, and acording to http://library.gnome.org/devel/gtk/2.10/GtkFileChooserButton.html#id3631060 gtk_file_chooser_button only supports the GtkFileChooserActions GTK_FILE_CHOOSER_ACTION_OPEN and GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, not the GTK_FILE_CHOOSER_ACTION_SAVE

GTK_FILE_CHOOSER_ACTION_OPEN Indicates open mode. The file chooser will only let the user pick an existing file. GTK_FILE_CHOOSER_ACTION_SAVE Indicates save mode. The file chooser will let the user pick an existing file, or type in a new filename.

So, if someone like I wants to write a nonexistent file, and this file has to be selected by the user, the obvious solution is to use SF-DIRNAME to get the directory and follow a SF-STRING to get the filename.
After that, a (string-append dirname "/" filename) in the code gives the full path.

Yours
Pere