~ubuntu-branches/ubuntu/trusty/rgtk2/trusty

« back to all changes in this revision

Viewing changes to man/gtkFileChooserSetFile.Rd

  • Committer: Bazaar Package Importer
  • Author(s): Dirk Eddelbuettel
  • Date: 2010-11-03 11:35:46 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20101103113546-a7fi7jdxdebp0tw1
Tags: 2.20.1-1
* New upstream release

* debian/control: Set (Build-)Depends: to current R version
* debian/control: Set Standards-Version: to current version 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\alias{gtkFileChooserSetFile}
 
2
\name{gtkFileChooserSetFile}
 
3
\title{gtkFileChooserSetFile}
 
4
\description{Sets \code{file} as the current filename for the file chooser, by changing
 
5
to the file's parent folder and actually selecting the file in list.  If
 
6
the \code{chooser} is in \code{GTK_FILE_CHOOSER_ACTION_SAVE} mode, the file's base name
 
7
will also appear in the dialog's file name entry.}
 
8
\usage{gtkFileChooserSetFile(object, file, .errwarn = TRUE)}
 
9
\arguments{
 
10
\item{\verb{object}}{a \code{\link{GtkFileChooser}}}
 
11
\item{\verb{file}}{the \code{\link{GFile}} to set as current}
 
12
\item{.errwarn}{Whether to issue a warning on error or fail silently}
 
13
}
 
14
\details{If the file name isn't in the current folder of \code{chooser}, then the current
 
15
folder of \code{chooser} will be changed to the folder containing \code{filename}. This
 
16
is equivalent to a sequence of \code{\link{gtkFileChooserUnselectAll}} followed by
 
17
\code{\link{gtkFileChooserSelectFilename}}.
 
18
  
 
19
Note that the file must exist, or nothing will be done except
 
20
for the directory change.
 
21
  
 
22
If you are implementing a \emph{File/Save As...} dialog,
 
23
you should use this function if you already have a file name to which the
 
24
user may save; for example, when the user opens an existing file and then
 
25
does \emph{File/Save As...} on it.  If you don't have
 
26
a file name already -- for example, if the user just created a new
 
27
file and is saving it for the first time, do not call this function.
 
28
Instead, use something similar to this:
 
29
\preformatted{if (document_is_new)
 
30
  {
 
31
    /* the user just created a new document */
 
32
    gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
 
33
    gtk_file_chooser_set_current_name (chooser, "Untitled document");
 
34
  }
 
35
else
 
36
  {
 
37
    /* the user edited an existing document */
 
38
    gtk_file_chooser_set_file (chooser, existing_file);
 
39
  }
 
40
}
 
41
  Since 2.14}
 
42
\value{
 
43
A list containing the following elements:
 
44
\item{retval}{[logical] \code{TRUE} if both the folder could be changed and the file was
 
45
selected successfully, \code{FALSE} otherwise.}
 
46
\item{\verb{error}}{ location to store the error, or \code{NULL} to ignore errors. \emph{[  \acronym{allow-none}  ]}}
 
47
}
 
48
\author{Derived by RGtkGen from GTK+ documentation}
 
49
\keyword{internal}