Re: [Rd] Plot window does not update in embedded code

2010-07-28 Thread Jan van der Laan
Took a while to find enough time to have a good look at this, but I have this working now. I am using the for-loop calling the handlers. Using only R_CheckUserInterrupt() did not work. It was a bit of work to track down all of the function declarations in R's source. Thanks! Regards, Jan On Th

Re: [Rd] Plot window does not update in embedded code

2010-07-22 Thread Simon Urbanek
On Jul 22, 2010, at 3:31 AM, Jan van der Laan wrote: > Thomas, Simon, > > Thank you for your answers. I will have a look at the code Thomas gave > me and probably also have another look at src/unix/sys-std.c. I'll get > back when I have this working, or, more likely, when I can't get this > to w

Re: [Rd] Plot window does not update in embedded code

2010-07-22 Thread Jan van der Laan
Thomas, Simon, Thank you for your answers. I will have a look at the code Thomas gave me and probably also have another look at src/unix/sys-std.c. I'll get back when I have this working, or, more likely, when I can't get this to work. As for the example code. I know it is very fragile. I tried t

Re: [Rd] Plot window does not update in embedded code

2010-07-21 Thread Simon Urbanek
On Jul 21, 2010, at 4:28 PM, Simon Urbanek wrote: > Use > R_CheckUserInterrupt() > Actually, the above is true but assumes that you're running R's REPL and not your own R_ReadConsole (it will work even in your ReadConsole but unix handlers are not run in that case so only some events will wor

Re: [Rd] Plot window does not update in embedded code

2010-07-21 Thread Simon Urbanek
Use R_CheckUserInterrupt() The code below is very fragile and unix-specific. Cheers, Simon On Jul 21, 2010, at 3:45 PM, Thomas Friedrichsmeier wrote: > Hi, > > On Wednesday 21 July 2010, Jan van der Laan wrote: >> How do I ensure that the windows keep being updated? > > in RKWard we run th

Re: [Rd] Plot window does not update in embedded code

2010-07-21 Thread Thomas Friedrichsmeier
Hi, On Wednesday 21 July 2010, Jan van der Laan wrote: > How do I ensure that the windows keep being updated? in RKWard we run the following periodically during idle phases: // this basically copied from R's unix/sys-std.c (Rstd_ReadConsole) #ifndef Q_WS_WIN for (;;) { f

[Rd] Plot window does not update in embedded code

2010-07-21 Thread Jan van der Laan
Dear list, I am trying to embed R into a C++ program. After some tinkering, reading the documentation and browsing the source code I have this more or less working. A very very condensed and very simplified version of the code is included below. The program can create plots. However, after the pl