How do I use in an Xt app?

Post questions, comments and feedback to our 3Dconnexion UNIX and Linux Development Team.

Moderator: Moderators

Post Reply
kula
Posts: 3
Joined: Wed May 28, 2008 7:50 am

How do I use in an Xt app?

Post by kula »

Howdy,
I tried this: (I tried the XtAddEventHandler before and after MagellanInit)

XtAddEventHandler(glWidget,NoEventMask,True,myEventHandler,0);
if ( !MagellanInit( dpy, glWidget ) )
{
fprintf( stderr, "No driver is running. \n" );
}

XtAppMainLoop(app);
return 1;

. . .

MagellanInit succeeds, but myEventHandler never gets called. Any suggestions?

Thanks!
Kula
kula
Posts: 3
Joined: Wed May 28, 2008 7:50 am

It Works Now!

Post by kula »

I waited around and worked on another project, but after reading the Xt source code!! the path was clear (I guess nobody is writing an Xt based Linux app?)

The trick is to use XtSetEventDispatcher(dpy, ClientMessage, myDispatcher)

instead of XtAddEventHandler.

myDispatcher is only called when the XEvent is ClientMessage and then its copy and paste from the sample app's ClientMessage handler.

I think there's a problem using XtAddEventHandler for non-maskable events?
Post Reply