Ibrahim Haddad wrote:
> I am drawing objects in a Motif drawing area using X libraries routinres
> such as drawRectangle/line/... Every object has 4 coordinates: x1,y1 and
> x2,y2.
> I need to be able to: Whenever I detect a mouse click, see what are its
> coordinates, and if it falls within the borders of some object, then I would
> popup an information window using XtAddCallback(). So, my questions are:
> How to detect a mouse click? and how to know its coordinates?
Register a callback function on the XmNinputCallback list. The
function will be passed a pointer to a XmDrawingAreaCallbackStruct:
typedef struct
{
int reason;
XEvent * event;
Window window;
} XmDrawingAreaCallbackStruct;
You can get the mouse coordinates from the `event' field.
--
Glynn Clements <[EMAIL PROTECTED]>