| T.R | Title | User | Personal Name
 | Date | Lines | 
|---|
| 756.1 |  | LEOVAX::TREGGIARI |  | Wed May 10 1989 14:01 | 22 | 
|  | >    Can anybody tell me what the difference is between using
>    
>    XtMainLoop();
>    
>    and
>    
>    for ( ; ; )
>     {
>      XtNextEvent( &event );
>      XtDispatchEvent( &event );
>      }
There should be no difference.
   
>    I am trying to get some events not associated with a widget and
>    this is the only way I can think of doing it.
  
Is any of the code to do that being executed now?  That is, are you
doing anything else in the loop besides XtNextEvent, XtDispatchEvent?
Leo
 | 
| 756.2 | Filter Out Events?? | TOOK::MERSHON | Ric Mershon | Wed May 10 1989 14:15 | 21 | 
|  | 	
>    I am trying to get some events not associated with a widget and
>    this is the only way I can think of doing it.
	Here's my best guess:
	You say you are trying to get some events not associated with
	a widget.  Are these possibly events generated by something
	that you wouldn't want to dispatch on?  I once did some playing
	around with DECterm to get its events to pass through my event
	processing loop.  I made sure that if the event that I got with
	XtNextEvent was from the DECterm, that I filtered it out and didn't
	pass it to XtDispatchEvent.
	This may be the problem, and it may not; it's only my best
	guess.
	Hope this helps,
	-ric.
 | 
| 756.3 | XEvent? | DECWIN::KLEIN |  | Wed May 10 1989 14:52 | 12 | 
|  | >>    for ( ; ; )
>>     {
>>      XtNextEvent( &event );
>>      XtDispatchEvent( &event );
>>      }
How are you declaring "event"?  To get the right size buffer, use:
	XEvent event;
-steve-
 | 
| 756.4 | Still stuck | 42397::HIRST_SJ | Lean, Mean, Fast | Thu May 11 1989 05:01 | 34 | 
|  |     A bit more explanation.
    
    Re .3
    
    I am declaring 'event'
    
    static XAnyEvent event;
    
    The additional events come from the window manager window. I locate
    the window manager window and do a XSelectInput with the
    SubstructureNotifyMask. The reason being the application is basically
    captive with a tiled window at the left of the screen with
    OverrideRedirect set so it is always at the front. If any other
    window is configured in the same area I move it so it is visible
    (This may not be friendly but it is only a prototype).
    
    Using:
    
    XtMainLoop();
    
    even with the additional input selected works fine.
    
    Using:
    
    XtNextEvent();
    XtDispatchEvent();
    
    with or without the additional events selected fails. The ACCVIO
    actually occurs in DwtFetchWidget in a callback routine.
    
    Thanks for all the ideas so far.
    
    Stephen
 | 
| 756.5 | You have a problem | 52494::LACROIX | Gone with the wind | Thu May 11 1989 08:16 | 13 | 
|  |     Re .4:
>    static XAnyEvent event;
    I don't know whether this is your problem, but this is wrong. Re-read
    the relevant section in the Xlib manual: XAnyEvent is a convenience
    structure to access members common to any event. Since many events are
    larger than XAnyEvent, Xlib is probably overwriting some data critical
    to your program... Use: static XEvent event instead. Why static, by the
    way?
    Denis.
 | 
| 756.6 |  | 42397::HIRST_SJ | Lean, Mean, Fast | Thu May 11 1989 12:07 | 8 | 
|  |     Re .5
    
    That seems to have been the problem.
    
    Thanks
    
    Stephen
 |