The R Project SVN R

Rev

Rev 68948 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68948 Rev 76382
Line 220... Line 220...
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()
-
 
226
   eval(parse(text = tclvalue(tkget(txt.w, "0.0", "end"))))
225
eval.txt <- function() eval(str2lang(tclvalue(tkget(txt.w, "0.0", "end"))))
227
tkpack(but.w <- tkbutton(tt, text = "Submit", command = eval.txt))
226
tkpack(but.w <- tkbutton(tt, text = "Submit", command = eval.txt))
228
 
227
 
229
## Try pressing the button, edit the text and when finished:
228
## Try pressing the button, edit the text and when finished:
230
 
229
 
231
tkdestroy(tt)
230
tkdestroy(tt)