Re: Python-fu: difference between PF_FILE and PF_FILENAME, and how to ask for a file name to *create*

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

 



OK, makes sense. Now, how can I prompt for the name of a file that doesn't exist (yet)?

On 11/14/2011 01:32 PM, Jerry Baker wrote:
PF_FILENAME: Only allows the user to choose a file.
PF_DIRNAME: Only allows the user to choose a directory.

PF_FILE: Allows the user to choose a file or a directory depending on what your default string is.

If you put a '/' at the end of the default string it will prompt the user for a directory.
If you leave off the '/' at the end of the default string it will prompt the user for a file.

Examples:
(PF_FILE, "pf_afile", _("Choose File:"), "/home/jbaker"),    # Choose a file
(PF_FILE, "pf_adir", _("Choose Directory:"), "/home/jbaker/"),    # Choose a directory

or

(PF_FILE, "pf_afile", _("Choose File:"), ""),
(PF_FILE, "pf_adir", _("Choose Directory:"), "/"),

-----Original Message-----
From: Ofnuts <ofnuts@xxxxxxxxxxx>
To: gimp-developer-list@xxxxxxxxx <gimp-developer-list@xxxxxxxxx>
Subject: Python-fu: difference between PF_FILE and PF_FILENAME, and how to ask for a file name to *create*
Date: Sun, 13 Nov 2011 22:44:21 +0100

I'm writing a python plugin that saves things to a file, and I'm trying 
to come up with the right parameter type to obtain a filename form the user.

There are PF_FILE and PF_FILENAME parameter types. Both correspond to a 
string with the file name in it. Furthermore the file must exist for 
both, so they cannot be used for the name of a file to be created? Why 
are there two types if they do the same thing? Am I missing something?


_______________________________________________
gimp-developer-list mailing list
gimp-developer-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gimp-developer-list

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux