[comp.windows.x] XtTimerCallbackProc documentation

cox@sun.software.org (Guy Cox) (06/19/91)

I have discovered an inconsistency in the documentation for XtTimerCallbackProc. In the O'Reilly Volume 4 page 229 there is a "Notice that the timeout function is called with only one argument, client_data. The xtertis example is implemented this way. In Volume 5 the Reference manual page 321 the function is
shown with two parameters client_data and the id of the timer.

XtTimerIntervalId is defined in Intrinsic.h as an unsigned long. When the
timer is created I print the value. In the timer_proc which is called when
the timer expires I again print the value. It doesn't match.

On top of this it doesn't appear that I am able to have more than 1 timer 
active at a given time. In this application I am trying to provide an error
message to the user if a query to a database server has not been serviced within the specified time interval. I create a widget which will eventually display the results, send the query and set the timer. When two queries overlap the second query bashes the first query..

So what reference in O'Reilly is correct ?
 

and 

Is there anything dumb being done here ?

  case 'a' :
    sscanf(buf,"%1c-%5s ",flag,label);
    printf("adding a widget %s\n",label);
    dest = (WDEST *)malloc(sizeof dest);
    dest->w = make_a_dialog(label);
    dest->timer = XtAddTimeOut(10000L,timer_callback,label);
    printf("the timer id is %d\n",dest->timer);
    AddWidget(dest,wlp);
    break;
  case 'd':
    printf("deleting a widget\n");
    sscanf(buf,"%1c-%d",flag,&wid);
    printf("Widget id %d\n",wid);
    break;

-- 
//
// Why do we park on our driveways, drive on our parkways ?
//

Guy O. Cox, Jr.  
Software Productivity Consortium.
2214 RockHill Rd
Herndon, VA 22090