[R] R Tcl/Tk [MacOSX] TkButton Problem

Stefan Richter stefan.stafra at web.de
Sun Feb 27 16:09:41 CET 2011


Hi,

> On 11-02-27 7:31 AM, Stefan Richter wrote:
>> Hi,
>> 
>> I have a tktoplevel window and in it a tkbutton:
>> 
>> AUS<- function()
>> {
>> 	foo(parameters);
>> }
>> AUSButton.but<- tkbutton(tt,text="OK",command=AUS)
>> 
>> The function foo(...) does a time-consuming calculation, and during this calculation there is printed some progress information to the console.
>> 
>> My problem: When I click the button "OK", the tktoplevel window and the R console don't react anymore, and there is nothing printed to the console until the calculation is finished (then all informations are printed out in one step).
>> If I simply execute foo(...) in the console, the progress information is printed out step by step, as I want.
>> 
>> Is there a possibility to change the call of foo(...) in this way that R and the window don't stop responding?
> 
> The flush.console() function will cause R to display pending text if you're running in the GUI.
> 
> Duncan Murdoch

Thank you for your reply!
I tried it and put  flush.console() after each print(...), but again nothing happend until the calculation was finished. I don't think the problem is the "output procedure".
It looks as if R would crash when I click on the button "OK" (but it does'nt crash, it is only calculating and doesn't response until it is ready).
So I think the function foo(...) has to be called in another way (?)

Stefan Richter
 



More information about the R-help mailing list