XForms: Xforms -interaction and drawings

From: zaatri abdelouahab (zaatri@hotmail.com)
Date: Sat Apr 08 2000 - 12:41:03 EDT

  • Next message: Steve Lamont: "Re: XForms: Xforms -interaction and drawings"

    # To subscribers of the xforms list from "zaatri abdelouahab" <zaatri@hotmail.com> :


    I thank you steve for you help. Now the interaction with my canvas works
    pretty well. But I dont know why I cant dram lines over it. For instance,
    in the previous version of xforms I use :
      fl_rect(mx-4,my-4,4,4,30) to draw a square arount the point of coordinates
    mx, my. Now the drawing doesnt appear.
      Here is the test program.
    Thanks for any help.

      /*Tring to built a program----> /yoyo/newimage.c
    A.ZAATRI the 4th April 2000
    ??? But now there is a problem with fl_rectangle???***/

    #include "forms.h"
    #include "stdlib.h"
    #include "stdio.h"
    #include "newimage.h"
    #include "time.h"
    #include "sys/types.h"

    FL_FORM *control;
    FL_OBJECT *obj;
    FL_OBJECT *pic1, *pic2, *text, *obj4;


    int my_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;
      printf("x=%d y=%d\n",mx,my);


    int main(int argc, char *argv[])
      FL_IMAGE *image, *image2;
      FL_OBJECT *obj, *obj3, *pic1, *pic2, *text, *frame1, *mouse, *misc;
    int dis;
    char buf[128], wl[128];
    int wx,wy,sw,sh,sx,sy;

    static FLIMAGE_SETUP setup;
       fl_initialize(&argc, argv, 0, 0, 0);

      control = fl_bgn_form(FL_NO_BOX, 800, 800);
      obj3 = fl_add_box(FL_UP_BOX,0,0,800,800,"");

    fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
    fl_set_object_color(pic1, FL_COL1, FL_COL1);

    pic2 = obj = fl_add_canvas(FL_NORMAL_CANVAS,10,560,770,1040,"");
    fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
    fl_set_object_color(pic2, FL_COL1, FL_COL1);

    fl_add_canvas_handler(pic1,ButtonPress, my_button_handler,0);
    fl_add_canvas_handler(pic2,ButtonPress, my_button_handler,0);




    printf("New york1 LOADING :%d\n",image);

    dis=flimage_display(image, FL_ObjWin(pic1));
    printf("New york DISPLAYING :%d\n",dis);

    while( fl_do_forms());
    return 0;


    Get Your Private, Free Email at http://www.hotmail.com

    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/

    This archive was generated by hypermail 2b29 : Sat Apr 08 2000 - 12:56:11 EDT