The R Project SVN R

Rev

Rev 61168 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61168 Rev 61433
Line 205... Line 205...
205
  There are far too many of these commands to describe them and their
205
  There are far too many of these commands to describe them and their
206
  arguments in full. Please refer to the Tcl/Tk documentation for details.
206
  arguments in full. Please refer to the Tcl/Tk documentation for details.
207
  Except for a few exceptions, the pattern is that  Tcl widget commands
207
  Except for a few exceptions, the pattern is that  Tcl widget commands
208
  possibly with subcommands like
208
  possibly with subcommands like
209
  \code{.a.b selection clear} are converted to function names like
209
  \code{.a.b selection clear} are converted to function names like
210
  \code{tkselection.clear} and the widget is given as the first argument. 
210
  \code{tkselection.clear} and the widget is given as the first argument.
211
}
211
}
212
\seealso{\code{\link{TclInterface}}, \code{\link{TkWidgets}},
212
\seealso{\code{\link{TclInterface}}, \code{\link{TkWidgets}},
213
  \code{\link{TkCommands}}} 
213
  \code{\link{TkCommands}}}
214
 
214
 
215
\examples{
215
\examples{
216
\dontrun{
216
\dontrun{
217
## These cannot be run by examples() but should be OK when pasted
217
## These cannot be run by examples() but should be OK when pasted
218
## into an interactive R session with the tcltk package loaded
218
## into an interactive R session with the tcltk package loaded
219
 
219
 
220
tt <- tktoplevel()
220
tt <- tktoplevel()
221
tkpack(txt.w <- tktext(tt))
221
tkpack(txt.w <- tktext(tt))
222
tkinsert(txt.w, "0.0", "plot(1:10)")
222
tkinsert(txt.w, "0.0", "plot(1:10)")
223
 
223
 
224
# callback function 
224
# callback function
225
eval.txt <- function()
225
eval.txt <- function()
226
   eval(parse(text = tclvalue(tkget(txt.w, "0.0", "end"))))
226
   eval(parse(text = tclvalue(tkget(txt.w, "0.0", "end"))))
227
tkpack(but.w <- tkbutton(tt, text = "Submit", command = eval.txt))
227
tkpack(but.w <- tkbutton(tt, text = "Submit", command = eval.txt))
228
 
228
 
229
## Try pressing the button, edit the text and when finished:
229
## Try pressing the button, edit the text and when finished: