Subject: Re: Tcl_DoOneEvent is driving me crazy ! - DN [1]
Scott Stanton <scott.stanton@Scriptics.com> - 30 Apr 1999 - comp.lang.tcl
Chris Harding wrote:
> XEvent ev;
> for(;;){
> if(XtAppPending(appCon)){ // is there an X event waiting ?
> XtAppNextEvent(appCon, &ev); // yes, process it
> XtDispatchEvent(&ev);
> }
> else {
> // process any tcl event but do not block !
> Tcl_DoOneEvent(TCL_DONT_WAIT | TCL_ALL_EVENTS);
> }
> }
> Anybody have any advice how to nail down what is going wrong. I guess I
> could always
> write my own version of Tcl_DoOneEvent() ....
The problem here is that XtAppPending doesn't know anything about Tk's
connection to the X server, so it isn't waking up when events happen on the Tk
side. You need to use the Xt based notifier. You can replace
unix/tclUnixNotfy.c with unix/tclXtNotify.c when you build Tcl. Also, take a
look at tclXtTest.c for an example of how to construct an Xt based event loop.
___________________________________________________________
Scott Stanton 650-210-0105 tel
Sr. Software Engineer 650-210-0101 fax
Scriptics Corporation scott.stanton@scriptics.com
The Tcl Platform Company http://www.scriptics.com
Last modified
1999-09-27
1999-09-27
(195.108.246.50)
Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated
