[rkward-cvs] rkward/rkward/rbackend rembedinternal.cpp,1.13,1.14

Thomas Friedrichsmeier tfry at users.sourceforge.net
Tue May 3 20:56:17 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/rbackend
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18243/rkward/rbackend

Modified Files:
	rembedinternal.cpp 
Log Message:
Fix for proper handling of Tcl-Tk windows. Now you can even do
> library (tcltk)
> tkStartGUI ()
Ok, the tcl-console will not do anything, but who needs another console. The other stuff seems to work fine.

Index: rembedinternal.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/rbackend/rembedinternal.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** rembedinternal.cpp	20 Apr 2005 17:41:36 -0000	1.13
--- rembedinternal.cpp	3 May 2005 20:56:14 -0000	1.14
***************
*** 48,51 ****
--- 48,53 ----
  }
  
+ static int testcounter = 0;
+ 
  void REmbedInternal::processX11Events () {
  /* what we do here is walk the list of objects, that have told R, they're listening for events.
***************
*** 59,62 ****
--- 61,75 ----
  		handler = handler->next;
  	}
+ 
+ /* I don't really understand what I'm doing here, but apparently this is necessary for Tcl-Tk windows to function properly. */
+ 	R_PolledEvents ();
+ 	
+ /* Maybe we also need to also call R_timeout_handler once in a while? Needed for tkStartGUI () to do something. Obviously this is
+ extremely crude code! */
+ 	if (++testcounter < 1000) {
+ 		extern void (* R_timeout_handler) ();
+ 		if (R_timeout_handler) R_timeout_handler ();
+ 		testcounter = 0;
+ 	}
  }
  





More information about the rkward-tracker mailing list