3
3
\title{gtkFileChooserSetFilename}
4
4
\description{Sets \code{filename} as the current filename for the file chooser, by changing
5
5
to the file's parent folder and actually selecting the file in list. If
6
the \code{chooser} is in \verb{GTK_FILE_CHOOSER_ACTION_SAVE} mode, the file's base name
6
the \code{chooser} is in \code{GTK_FILE_CHOOSER_ACTION_SAVE} mode, the file's base name
7
7
will also appear in the dialog's file name entry.}
8
8
\usage{gtkFileChooserSetFilename(object, filename)}
10
\item{\verb{object}}{[\verb{\link{GtkFileChooser}}] a \verb{\link{GtkFileChooser}}}
11
\item{\verb{filename}}{[char] the filename to set as current}
10
\item{\verb{object}}{a \code{\link{GtkFileChooser}}}
11
\item{\verb{filename}}{the filename to set as current}
13
13
\details{If the file name isn't in the current folder of \code{chooser}, then the current
14
14
folder of \code{chooser} will be changed to the folder containing \code{filename}. This
18
18
Note that the file must exist, or nothing will be done except
19
19
for the directory change.
21
If you are implementing a \emph{File/Save As...} dialog, you
22
should use this function if you already have a file name to which the user may save; for example,
23
when the user opens an existing file and then does \emph{File/Save As...}
24
on it. If you don't have a file name already -- for example, if the user just created
25
a new file and is saving it for the first time, do not call this function. Instead, use
26
something similar to this:
27
\preformatted{if (document_is_new)
21
If you are implementing a \emph{File/Save As...} dialog,
22
you should use this function if you already have a file name to which the
23
user may save; for example, when the user opens an existing file and then
24
does \emph{File/Save As...} on it. If you don't have
25
a file name already -- for example, if the user just created a new
26
file and is saving it for the first time, do not call this function.
27
Instead, use something similar to this:
28
\preformatted{if (document_is_new)
29
/ * the user just created a new document * /
30
/* the user just created a new document */
30
31
gtk_file_chooser_set_current_folder (chooser, default_folder_for_saving);
31
32
gtk_file_chooser_set_current_name (chooser, "Untitled document");
35
/ * the user edited an existing document * /
36
/* the user edited an existing document */
36
37
gtk_file_chooser_set_filename (chooser, existing_filename);
41
41
\value{[logical] \code{TRUE} if both the folder could be changed and the file was
42
42
selected successfully, \code{FALSE} otherwise.}
43
43
\author{Derived by RGtkGen from GTK+ documentation}