Re: XForms: fl_mouse_button problem !

From: Antonio Buitrago (
Date: Thu Mar 15 2001 - 03:09:11 EST

  • Next message: Praveen Thiagarajan: "Re: XForms: fl_mouse_button problem !"

    # To subscribers of the xforms list from Antonio Buitrago <> :

    Praveen Thiagarajan escribió:

    > 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);

            When you add a canvas handler, you must handle it directly by X, using
    the XEvent.
    Your callback function could be as follows,

     int mbutton_cb(FL_OBJECT *ob, Window win, int w, int h, XEvent *xev,
                    void *ud)
         case Button1:
           printf("LEFT BUTTON\n");
         case Button3:
           printf("RIGHT BUTTON\n");
         case Button2:
           printf("MIDDLE BUTTON\n");
       return 0;
    To unsubscribe, send the message "unsubscribe" to or see
    XForms Home Page:
    List Archive:

    This archive was generated by hypermail 2b29 : Wed Mar 14 2001 - 22:11:46 EST