Hi I have written a graphical user interface using tcltk. Now I would like to run it under rterm.exe with a batch file. I tried the following code written in a .bat file: d:\R\rw1071\bin\Rterm.exe --no-restore --no-save <d:\RGui.r> d:\RGui.out The problem is that rterm does open but the gui isn't running properly. After a few seconds rterm is closeing without doing anything more than print the first gui window. If I run the same r-code in the normal RGui.exe I don't have any problems. Does anyone know what I'm doing wrong, or is there a help file which explains the needed code? thanks Sascha Morach, a student from ZHW switzerland
That's exactly what a batch file should do. There is no GUI to run. Please tell us what you actually want to do! On Mon, 3 Nov 2003, Morach Sascha, moracsa1 wrote:> Hi > > I have written a graphical user interface using tcltk. Now I would like to run it under rterm.exe with a batch file. I tried the following code written in a .bat file: > > d:\R\rw1071\bin\Rterm.exe --no-restore --no-save <d:\RGui.r> d:\RGui.out > > The problem is that rterm does open but the gui isn't running properly. After a few seconds rterm is closeing without doing anything more than print the first gui window. If I run the same r-code in the normal RGui.exe I don't have any problems. > Does anyone know what I'm doing wrong, or is there a help file which explains the needed code? > > > thanks > Sascha Morach, a student from ZHW switzerland-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Mon, Nov 03, 2003 at 10:35:57AM +0100, Morach Sascha, moracsa1 wrote:> Hi > > I have written a graphical user interface using tcltk. Now I would like to run it under rterm.exe with a batch file. I tried the following code written in a .bat file: > > d:\R\rw1071\bin\Rterm.exe --no-restore --no-save <d:\RGui.r> d:\RGui.out > > The problem is that rterm does open but the gui isn't running properly. After a few seconds rterm is closeing without doing anything more than print the first gui window. If I run the same r-code in the normal RGui.exe I don't have any problems. > Does anyone know what I'm doing wrong, or is there a help file which explains the needed code?I use a trick which Peter D. once emailed. You need to initialise a variable, say, wait.gui, to zero. If and when the user wants to quit (File->Exit or whatever, you also need to fetch the window closing event from the window manager) you set wait.gui to 1. Then a call to tk.wait(wait.gui) in your main part should be all that is needed. Hth, Dirk -- Those are my principles, and if you don't like them... well, I have others. -- Groucho Marx