Re: XForms: version .89 bug: fl_drw_text

From: Keith Tang (keith.tang@marathonelectric.com)
Date: Mon Mar 19 2001 - 15:28:36 EST

  • Next message: Steve Lamont: "Re: XForms: version .89 bug: fl_drw_text"

    > # To subscribers of the xforms list from Steve Lamont <spl@ncmir.ucsd.edu> :
    >
    > > I don't know if this is sufficient information to track down the problem.
    >
    > No, it isn't.
    >
    > > With some work I probably could supply some code to demonstate the
    > > problem.
    >
    > That would be most helpful. Without it, it's just guesswork.

    After further digging, I found the statement which was causing the fl_drw_txt
    to revert back to the parent form. In the function which did the fl_drw_txt
    was
    an fl_check_forms call (a remnant from previous debugging). This does not
    cause the revertion to the parent with version 0.88 but does with version 0.89.

    When the fl_check_forms is removed the output goes to the desired form.

    Now that I know what causes it, it's no longer a problem. I don't know if
    anybody wants to make changes to make 0.89 consistent with 0.88. Just in
    case there is interest, I'll attach a drwtxt.c program which demonstrates the
    characteristic.

    It can be compliled with:

      gcc drwtxt.c -o drwtxt -L/usr/X11R6/lib -lforms -lX11 -lm

    SECOND QUESTION:

    >
    >
    > > I have a couple of systems which I used the XFree86 4.0 in order
    > > to achieve compatibility with the video cards. The systems using
    > > 4.0 lose the graphics generated with fl_drw_line and fl_drw_text
    > > when covered by another window. This does not happen with
    > > XFree86 3.3.6.
    >
    > It sounds as if whatever is calling the fl_drw_*() functions isn't
    > getting an Expose event to refresh the displayed data.
    >
    > spl
    >

    Could I normally expect the fl_drw_*() functions to be refreshed by
    xforms or is this a function of the window manager?

    Keith Tang


    /* Form definition file generated with fdesign. */

    /* gcc drwtxt.c -o drwtxt -L/usr/X11R6/lib -lforms -lX11 -lm */

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

    FL_FORM *CreMesForm(void);

    void main(int argc, char **argv)
    {
            FL_FORM *mform, *mesform;
            FL_OBJECT *o;
            int i, bgc = 11;
            
            fl_initialize(&argc, argv, "drwtxt", 0, 0);

            
            mform = fl_bgn_form(FL_NO_BOX, 300, 200);
            o = fl_add_box(FL_UP_BOX, 0, 0, 300, 200, "");
            
            fl_set_object_color(o, 11, FL_WHITE);

            fl_end_form();
            fl_set_form_position(mform, 20, 20);

            fl_show_form(mform, FL_PLACE_GEOMETRY, FL_FULLBORDER, "drwtxt form 1");
            fl_drw_text(FL_ALIGN_LEFT, 20, 15, 180, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the main form");

            mesform = CreMesForm();

            o = fl_do_forms();

            fl_hide_form(mesform);
            fl_free_form(mesform);

            fl_hide_form(mform);
            fl_free_form(mform);
    }

    /**** Create message window with message and buttons, return FL_FORM pointer of new form ****
    */
    FL_FORM *CreMesForm(void)
    {
            FL_FORM *form;

            FL_OBJECT *TmpObj;

    /**** ceate the form ****/

            form = fl_bgn_form(FL_NO_BOX, 300, 200);
            TmpObj=fl_add_box(FL_UP_BOX, 0, 0, 300, 200, "");
            
            TmpObj=fl_add_box(FL_DOWN_BOX, 4, 4, 292, 192, "");
            fl_set_object_color(TmpObj, 11, FL_WHITE);

    /**** display the form ****/
            
            fl_end_form();
            fl_set_form_position(form, 340, 0);
            fl_show_form(form, FL_PLACE_GEOMETRY, FL_FULLBORDER, "drwtxt form 2");

    /**** set up message with labels ****/
            
            fl_drw_text(FL_ALIGN_LEFT, 20, 15, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 1");
            fl_drw_text(FL_ALIGN_LEFT, 20, 30, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 2");
            fl_drw_text(FL_ALIGN_LEFT, 20, 45, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 3");
            fl_drw_text(FL_ALIGN_LEFT, 20, 60, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 4");
            fl_drw_text(FL_ALIGN_LEFT, 20, 75, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 5");
            fl_drw_text(FL_ALIGN_LEFT, 20, 90, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 6");
            fl_check_forms();
            fl_drw_text(FL_ALIGN_LEFT, 20, 105, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 7");
            fl_drw_text(FL_ALIGN_LEFT, 20, 120, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 8");
            fl_drw_text(FL_ALIGN_LEFT, 20, 135, 280, 20, FL_BLACK, FL_FIXED_STYLE, 12, "this is the 2nd form, line 9");

            return form;
    }

    _________________________________________________
    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 : Mon Mar 19 2001 - 10:22:37 EST