Re: XForms: Interaction with images

From: Steve Lamont (
Date: Fri Apr 07 2000 - 10:04:02 EDT

  • Next message: Steve Lamont: "Re: XForms: Peculiar behavior of fl_get_folder_area()"

    # To subscribers of the xforms list from (Steve Lamont) :

    > 1)- I have developed, with a previous version of xforms that does
    > not support images, some applications using interaction with
    > freehandler defined as:
    > int freeobject_handler(FL_OBJECT *ob, int event, int mx, int my, int key, void *xev)
    > {
    > switch (event)
    > { case FL_PUSH:
    > printf("mx=%d my=%d\n",mx,my);
    > }
    > return 0;
    > }

    > This application enables me to read the coordinates of a pixel after
    > a mouse click.

    > Now that I have used images with canvas, it did not work. I did not
    > find out yet a way to read coordinates of a selected point inside a
    > canvas.

    If you have created a Canvas object to replace your Free object, then
    you need to install a button handler. Use

            fl_add_canvas_handler( your_canvas,
                                   your_special_data );

    and then create

            int your_button_handler( FL_OBJECT *obj, Window window,
                                     int window_width, int window_height,
                                     XEvent *xevent, void *user_data )


                XButtonEvent *xbutton_event = ( XButtonEvent *) xevent;
                int mx = xbutton_event->x;
                int my = xbutton_event->y;

    The manual, as always, has the gory details.

    To unsubscribe, send the message "unsubscribe" to or see
    XForms Home Page:
    List Archive:

    This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 10:13:40 EDT