[R] Rgui and tcltk

David Firth david.firth at nuffield.oxford.ac.uk
Thu Oct 26 12:14:16 CEST 2000


I am having a little problem in relation to sending output to the R 
Console window, when a function is called by pushing a button in a Tk 
window.  Actually there seem to be two components to the problem:
  -- the R prompt does not re-appear until <return> is pressed
  -- text output to the R Console window *disappears* after <return> is pressed

The following, in R 1.1.1 under Windows NT 4, and using Tcl/Tk 8.3, 
illustrates:

library(tcltk)
testwindow  <- tktoplevel()
testaction<-function(){cat("Hello\n")
                        flush.console()}
testbutton <- tkbutton(testwindow, text="Click me", command=testaction)
tkpack(testbutton)

This successfully makes a Tk window with a button.  But pressing the 
button does not do what I intended.  What I would like is for the 
button-press to print out "Hello" at the R Console, and return to the 
R prompt.  I would welcome any hints on how I am going wrong here.

Thanks -- David


> version
          _
platform Windows
arch     x86
os       Win32
system   x86, Win32
status
major    1
minor    1.1
year     2000
month    August
day      15
language R


David Firth                        Phone +44 1865 278544
Nuffield College                   Fax   +44 1865 278621
Oxford OX1 1NF                     Secretary +44 1865 278612
United Kingdom                     Email david.firth at nuffield.oxford.ac.uk

http://www.stats.ox.ac.uk/~firth/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list