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

« back to all changes in this revision

Viewing changes to man/gtkFileChooserSetFilename.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:
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)}
9
9
\arguments{
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}
12
12
}
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.
20
20
  
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)
28
29
  {
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");
32
33
  }
33
34
else
34
35
  {
35
 
    /    * the user edited an existing document *    / 
 
36
    /* the user edited an existing document */ 
36
37
    gtk_file_chooser_set_filename (chooser, existing_filename);
37
38
  }
38
 
}  
39
 
 
40
 
  Since  2.4}
 
39
}
 
40
  Since 2.4}
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}