Catching mouse move events on button

Catching mouse move events on button

Post by Mavinkul » Fri, 18 Nov 2005 15:15:01

Hi all,
I want to add callback to mouse move event on button but I am unable
to do it. I have written some thing like this,

wid = XtVaAppInitialize(&app, "Press", NULL, 0,
&argc, argv, NULL, NULL);

button = XmCreatePushButton(wid, "Press", NULL, 0);

XtAddEventHandler(button,KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask | StructureNotifyMask,
andler) YourGraphicsEventsCB,NULL);

And YourGraphicsEvents function goes as follows,
void YourGraphicsEventsCB(Widget w,XtPointer clientData,XEvent *event)

switch (event -> xany.type) {

case ButtonRelease:
printf ("Button is Released :)\n");

case ButtonPress:
printf ("Button is pressed :)\n");
break ;
case MotionNotify:
printf ("Mouse Event\n");

} /* end of switch statement */

But Mouse move event does not trigger YourGraphicsEventsCB function .
Please somebody explain how to do it.