Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
wptest.c
Go to the documentation of this file.00001 #include <X11/Intrinsic.h>
00002 #include <stdio.h>
00003
00004 Boolean workproc_A( XtPointer ) ;
00005 Boolean workproc_B( XtPointer ) ;
00006 void killit_CB( XtPointer , XtIntervalId * ) ;
00007
00008 static XtAppContext app ;
00009
00010
00011
00012 int main( int argc , char * argv[] )
00013 {
00014 Widget wid ;
00015
00016 wid = XtVaAppInitialize(
00017 &app, "Elvis", NULL, 0, &argc, argv, NULL, NULL ) ;
00018 if( wid == NULL ){
00019 fprintf(stderr,"*** Cannot initialize X11!\n") ; exit(1) ;
00020 }
00021
00022 XtAppAddTimeOut( app , 1234 , killit_CB , NULL ) ;
00023
00024 XtAppAddWorkProc( app, workproc_A, NULL ) ;
00025 XtAppMainLoop(app) ;
00026 exit(0) ;
00027 }
00028
00029
00030
00031 void killit_CB( XtPointer xyzzy , XtIntervalId * zork )
00032 { exit(0) ; }
00033
00034
00035
00036 #define WMAX 4
00037
00038 Boolean workproc_A( XtPointer elvis )
00039 {
00040 static int ncall=0 ;
00041
00042 if( ncall == 0 ) XtAppAddWorkProc( app, workproc_B, NULL ) ;
00043 ncall++ ; printf("workproc_A: %d\n",ncall) ;
00044 return (ncall < WMAX) ? False : True ;
00045 }
00046
00047
00048
00049 Boolean workproc_B( XtPointer presley )
00050 {
00051 static int ncall=0 ;
00052 ncall++ ; printf("workproc_B: %d\n",ncall) ;
00053 return (ncall < WMAX) ? False : True ;
00054 }
00055
00056
00057
00058
00059
00060 #ifdef NEED_XSETLOCALE
00061 #include <locale.h>
00062 char * _Xsetlocale( int category, const char * locale)
00063 { return setlocale(category,locale) ; }
00064 #endif