[comp.windows.x.motif] Gadgets and Events

roger@zuken.co.jp (Roger Meunier) (04/22/91)

Is there some way to use XtAddEventHandler() or XtAddRawEventHandler()
with gadgets?  I tried installing a ButtonPressMask event handler in a
XmCreatePushButtonGadget, and was surprised at the results.
It wouldn't even handle exposure events after that!

Does someone know a trick I can use to emulate event handling (or
translations) for a gadget?  Or am I asking too much?  I know that
the behavior is being managed somewhere; is there some way to modify
this behavior?

Any tips will be appreciated.
--
Roger Meunier @ Zuken, Inc.  Yokohama, Japan	(roger@zuken.co.jp)

slh@gibdo.engr.washington.edu (04/23/91)

In article <ROGER.91Apr22162443@rd13.zuken.co.jp> roger@zuken.co.jp (Roger Meunier) writes:
|Is there some way to use XtAddEventHandler() or XtAddRawEventHandler()
|with gadgets?  I tried installing a ButtonPressMask event handler in a
|XmCreatePushButtonGadget, and was surprised at the results.
|It wouldn't even handle exposure events after that!
|
	There are several things you can't have with gadgets,
	including event handlers and translations.
|Does someone know a trick I can use to emulate event handling (or
|translations) for a gadget?  Or am I asking too much?  I know that
|the behavior is being managed somewhere; is there some way to modify
|this behavior?
|
	You have to do stuff from the parent,
	keeping track of the children there.
	So, for example, if you wanted to do something when the pointer
	entered the gadget, you'd do event handling in the parent
	and check for the pointer being in the gadgets extent.

roger@zuken.co.jp (Roger Meunier) (04/24/91)

In article <1991Apr23.022507.18326@gibdo.engr.washington.edu> slh@gibdo.engr.washington.edu writes:

I wrote:
 > |Does someone know a trick I can use to emulate event handling (or
 > |translations) for a gadget?  Or am I asking too much?  I know that
 > |the behavior is being managed somewhere; is there some way to modify
 > |this behavior?

to which Some Kind Soul replied:
 > 	   You have to do stuff from the parent,
 > 	   keeping track of the children there.
 > 	   So, for example, if you wanted to do something when the pointer
 > 	   entered the gadget, you'd do event handling in the parent
 > 	   and check for the pointer being in the gadgets extent.

That's basically the lead that I need.  Thanx!

Now, one more quick question:  is there some way to alter the behavior
of the XmManager widget which has the Gadget as a child, e.g., through
resources?
--
Roger Meunier @ Zuken, Inc.  Yokohama, Japan	(roger@zuken.co.jp)