[comp.windows.x] Events, children, and window manage

ebina@mcdurb.Urbana.Gould.COM (02/22/89)

I need some help with event handling using the XtAddEventHandler call.

I have a composite widget that uses XtAddEventHandler to catch configure events,
and as a child of that widget I have another composite widget that uses
XtAddEventHandler to catch Button1Motion events.

The parent widget receives its events properly, but the child widget never
gets its events.  If I then kill the window manager (I am using uwm),
the child widget will start getting its events correctly.

Is there a way I can get events to the child widget while still running a
window manager?

			Thanks,
				Eric Bina
				ebina@urbana.mcd.mot.com

swick@ATHENA.MIT.EDU (Ralph R Swick) (02/22/89)

     Date:  21 Feb 89 17:37:00 GMT
     From:  mcdurb!ebina@uxc.cso.uiuc.edu

     
     and as a child of that widget I have another composite widget that uses
     XtAddEventHandler to catch Button1Motion events.

     The parent widget receives its events properly, but the child widget never
     gets its events.  If I then kill the window manager (I am using uwm),
     the child widget will start getting its events correctly.

If you are using the default button bindings in uwm, the button press
event is propagating up the window tree to the root window where it
is then going to uwm, causing the motion events to also go to uwm.

The child needs to select for ButtonPress (translation <Button1Press>
if you are using translation tables) if it wants to be sure to get
the MotionNotify events.  The event can be discarded if you're not
actually interested in it.

This is a common trap; I've fallen into it many times myself.