# To subscribers of the xforms list from Praveen Thiagarajan <praveen@capsl.udel.edu> :
This might be a little simple, but i am sort of stuck. I am using the
glcanvas to draw some stuff. Whenever a mouse button event occurs the
fl_mouse_button(), inside the callback always returns a 0. Any idea as
to what i am doing wrong here.
The callback definition is as follows,
fl_add_canvas_handler(ui->canvas, ButtonPress, mbutton_cb, 0);
The callback function is as follows,
int mbutton_cb(FL_OBJECT *ob, Window win, int w, int h, XEvent *xev,
void *ud)
{
switch(fl_mouse_button())
{
case FL_LEFT_MOUSE:
printf("LEFT BUTTON\n");
break;
case FL_RIGHT_MOUSE:
printf("RIGHT BUTTON\n");
break;
case FL_MIDDLE_MOUSE:
printf("MIDDLE BUTTON\n");
break;
default:
printf("%ld\n",fl_mouse_button());
break;
}
return 0;
}
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/
This archive was generated by hypermail 2b29 : Wed Mar 14 2001 - 17:54:05 EST