tomt@maui.coral.COM (Tom Tulinsky) (08/07/90)
In Motif, can a parent widget get the events like button presses, that happen in its children? The answer seems to be No, unlike X where events automatically propagate up to parent windows. I have a little Form with a couple of Labels that I would like to be able to drag around a DrawingArea, but it seems I have to select events on each widget separately. Coral * ** Tom Tulinsky 508 460-6010 * ** Coral Network Corporation fax 508 481-6258 * ** 734 Forest St net: tomt@coral.com *** Marlboro, MA 01752 ** U S A ********* NETWORKS
swick@ATHENA.MIT.EDU (Ralph Swick) (08/07/90)
In Motif, can a parent widget get the events like button presses, that happen in its children? The answer seems to be No, unlike X where events automatically propagate up to parent windows. Just as in [raw] X, events propagate outward only if the widget event mask indicates that the widget does not contain an event handler for the specific event type. With translations, accelerators, dynamic event handlers and the like, it can be hard to predict whether or not a widget window will have a particular bit set in its event mask. You could consider taking advantage of these mechanisms by installing accelerators from the parent onto the child, by augmenting the translation table of the child, or by installing explicit event handlers on the child. You could also consider using X's outside-in event distribution machinery, grabs, as soon as you have a version of Motif running on the R4 Intrinsics. The description of the procedure XtRegisterGrabAction is then what you'll want to read.