Re: XForms: interrogating a scrollbar

From: Angus Leeming (a.leeming@ic.ac.uk)
Date: Tue Dec 03 2002 - 10:21:55 EST

  • Next message: Angus Leeming: "XForms: The files in lib..."

    On Tuesday 03 December 2002 2:14 pm, Angus Leeming wrote:
    > I append the relevant code snippet below. Note how xforms currently uses a
    > "timdel" variable to ignore the callbacks 1-10 after the mouse button is
    > pressed. Thereafter, every other mouse event gets through.
    >
    > Proposal 1
    > use the current approach, but reset timdel to 0 after it's
    > reached 11.

    The patch attached does this and it works like a charm.

    Steve, would you like me to keep hold of these patches and resubmit them once
    1.0 is out of the door?

    Incidentally, and secondary to this, I append a report from the guy who
    initially submitted the bug report to us. I think that it makes interesting
    reading and leads to the question:

    Why do fl_do_forms and fl_check_forms use different values for the polling
    wait? Is this intentional or an oversight?

    Best regards,
    Angus

    ------- Additional Comment #9 From Laurence Tyler 2002-12-03 -------
    After a lot of code searching, I think I finally know what the problem is, and
    why my other xforms apps work as expected when LyX doesn't.

    There are two ways to get xforms to do its stuff: fl_do_forms(), which enters
    a loop and (usually) doesn't return, and fl_check_forms() which does one pass
    of updating the interface, polling events etc. and then returns to the main
    program. LyX uses fl_check_forms() while all the other xforms apps I've
    tested use fl_do_forms().

    Crucially, in the depths of the xforms library code, there is a polling wait
    for async I/O (using select() I think). The timeout for this operation is
    delta_msec in the case of fl_do_forms(), which has a value of 50 ms (40 ms if
    idle callbacks are used). However, fl_check_forms() calls the underlying code
    differently, resulting in a timeout of SHORT_PAUSE msec. SHORT_PAUSE is
    #defined as being 10. So if fl_check_forms() is called in a tight loop the
    upshot is that everything is called about 5 times as fast as with
    fl_do_forms().

    This, as far as I understand it, exactly accounts for the behaviour I'm
    seeing. I modified the little scrollbar test program to have
    'while(1) { fl_check_forms(); }' instead of 'fl_do_forms();'
    and sure enough - everything scrolls very fast. :-)



    _________________________________________________
    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 : Tue Dec 03 2002 - 10:16:49 EST