Well, I was going to completely judge all the answers that I saw to this question, because none of them worked on the windows. readline, tkwait.window, Sys.sleep (1e30), while (TRUE), none of them worked.
But I just updated R to v3.1.0, and now tkwait.window (yourmainwindow) works, and (TRUE) {} works, although Sys.sleep (1e30) still doesn't work.
Nothing ... I use tkwait.window because it is tk and is waiting for my window (this is what I want).
Getting, for example, from http://www.sciviews.org/_rgui/tcltk/OKtoplevel.html to work ... (comments are removed for brevity)
require(tcltk) tt <- tktoplevel() OK.but <- tkbutton(tt, text = "OK", command = function() tkdestroy(tt)) tkgrid(OK.but) tkfocus(tt) tkwait.window(tt) # <-- added this to make the window stay!
Jimi wlls
source share