Re: XForms: Drawing in the browser prehandler (better solution)

From: jac@casurgica.com
Date: Mon Apr 07 2003 - 21:13:31 EDT

  • Next message: Angus Leeming: "Re: XForms: uploading xforms-1.0.tar.gz to savannah.nongnu.org?"

    # To subscribers of the xforms list from jac@casurgica.com :

    Ok I found a much better solution than that hack with
    fl_set_ignore_drawing() or whatever I called it. Since the browser itself
    doesn't do any drawing, and since I'm only really interesting in drawing
    the text differently, it makes sense to do my custom drawing in the
    *textbox* prehandler, rather than in the browser's prehandler (duh...). So
    I did this in my test program:

    FL_HANDLEPTR s_oldtbpre = 0;

    void convert_browser (FL_OBJECT *br) {
      FL_OBJECT *tb = fl_get_object_component(br, FL_TEXTBOX, -1, 0);
      s_oldtbpre = fl_set_object_prehandler(tb, &br2_prehandler);
    };

    Tada. A simple (and glaringly obvious, now that I think about it)
    solution. I call s_oldtbpre() from my prehandler. It's OK, I think, to
    store the old callback pointer this way, because even when I'm dealing
    with multiple "custom" browsers at once, the default textbox prehandler
    will be the same for all of them (fl_create_browser sets it to tbpre()),
    so fl_set_object_prehandler() will return the same pointer for every
    browser's component textbox (the first time you call it for each browser's
    textbox, anyway, of course).

    That seems like the right thing to do... is any of this taboo at all? I'd
    rather do it right then hack it... but I'm kind of new to xforms so I
    don't have a good feel for what is acceptable practice yet.

    Thanks again,
    Jason Cipriani

    _________________________________________________
    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/
    Development: http://savannah.nongnu.org/files/?group=xforms



    This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 21:15:48 EDT