XForms: xforms & linux

From: yann.guichoux@ago.fr
Date: Mon Sep 11 2000 - 09:08:37 EDT

  • Next message: Dave Gotwisner: "XForms: FW: Help (or possible problem with pixmap buttons)"


    I send a mail to this list 2 a days ago, about a problem with the file

    >another problem apears while using the fileselector.
    >I have to double-click about 10 times on the "D.." line to make it
    >changing directory...(but only the first time i use the fileselector,
    >after this, it seems to work fine.)

    In fact, the problem seems to come from a "fl_timer" object (i
    reproduced this strange behaviour only under linux)

    I have modified the file fbrowse.c in the DEMO directory to test it ...
    I attached it with this mail (to test the fileselector, just click on
    the "load" button and try to change the current directory...). It looks
    like a bug.



     * This demo shows the use of a browser and a file selector.
     * Good browser/scrollbar test
     * This file is part of xforms package
     * T.C. Zhao and M. Overmars

    #include <stdio.h>
    #include <stdlib.h>
    #include "forms.h"

    typedef struct {
        FL_FORM *form;
        void *vdata;
        char *cdata;
        long ldata;
        FL_OBJECT *br;
        FL_OBJECT *fl_timer;
    } FD_form;

    void load_file(FL_OBJECT *ob, long arg)
        const char *fname;
        FD_form *fdui = ob->form->fdui;

        if((fname = fl_show_file_selector("File To Load","","*","")))
           if (! fl_load_browser(fdui->br,fname))
               fl_add_browser_line(fdui->br,"NO SUCH FILE!");
    void set_size(FL_OBJECT *ob, long arg)
        FD_form *fdui = ob->form->fdui;


    void exit_program(FL_OBJECT *ob, long data)

    void hide_show(FL_OBJECT *ob, long data)
        FD_form *fdui = ob->form->fdui;


    FD_form * create_form(void)
       FL_OBJECT *obj;
       FL_Coord x = 20, dx = 80, dy = 28;
       FD_form *fdui = fl_calloc(1, sizeof(*fdui));

       fdui->form = fl_bgn_form(FL_NO_BOX,590,610);
       obj = fl_add_box(FL_UP_BOX,0,0,590,610,"");

       fdui->br = obj = fl_add_browser(FL_NORMAL_BROWSER,20,20,550,530,"");
    /* fl_set_object_boxtype(obj,FL_EMBOSSED_BOX); */

       obj = fl_add_button(FL_NORMAL_BUTTON,x,565,dx-5,dy,"Load");
         x += dx ;
       obj = fl_add_lightbutton(FL_RADIO_BUTTON,x,565,dx,dy,"Tiny");
         x += dx;
       obj = fl_add_lightbutton(FL_RADIO_BUTTON,x ,565,dx,dy,"Small");
         fl_set_button(obj, FL_SMALL_SIZE == FL_BROWSER_FONTSIZE);
         x += dx;
       obj = fl_add_lightbutton(FL_RADIO_BUTTON,x ,565,dx,dy,"Normal");
         fl_set_button(obj, FL_NORMAL_SIZE == FL_BROWSER_FONTSIZE);
         x += dx;
       obj = fl_add_lightbutton(FL_RADIO_BUTTON,x ,565,dx,dy,"Large");
         x += dx + 4;
       obj = fl_add_button(FL_NORMAL_BUTTON,x,565,dx,dy,"Hide/Show");
        fl_set_object_callback(obj, hide_show, 0);
         x += dx + 5;
       obj = fl_add_button(FL_NORMAL_BUTTON,x,565,60,dy,"Exit");
         fl_set_object_callback(obj, exit_program, 0);

            fdui->fl_timer=fl_add_timer(FL_HIDDEN_TIMER, 0, 0,1, 1, "");

       fdui->form->fdui = fdui;
       return fdui;

    main(int argc, char *argv[])
       FD_form *fdui;

       fl_initialize(&argc, argv, "FormDemo", 0, 0);

       fdui = create_form();

       fl_add_browser_line(fdui->br,"LOAD A FILE.");




       return 0;

    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 : Mon Sep 11 2000 - 09:17:08 EDT