Re: XForms: Text not getting to label in timely fashion.

T.C. Zhao (tc_zhao@yahoo.com)
Thu, 4 Nov 1999 20:13:12 -0800 (PST)

# To subscribers of the xforms list from "T.C. Zhao" <tc_zhao@yahoo.com> :

call XFlush(fl_get_display()) after setting the label.
What's happening is that the request for drawing
is still on the client side then you put the
client to sleep. It never reached the X server.

To be absolutely sure, you may event want to
call XSync(fl_get_display(), 0). This call
not only will flush the request buffer, but actually
will wait until the server is done processing the
request.

--- Jeff Pierce <piercej@preferred.com> wrote:
> # To subscribers of the xforms list from Jeff Pierce
> <piercej@preferred.com> :
>
> I am trying to get a joystick working with n xforms program. Getting
> it
> working realy isn't the problem. I try to set up a calibration
> routine
> when a "Calibrate" button is pressed. The user is prompted by a text
> object to move the joystick to the upper left corner and press a
> joystick button. It then enters a loop reading /dev/js0 untill a js
> button is pressed.
>
> The problem is that the text message does not appear until AFTER the
> js
> button is pressed. Below is the "Calibrate" button callback.
>
> void calibrate_cb(FL_OBJECT *ob, long data)
> {
> long delay;
>
> fl_set_object_label(fd_joytest->calibrateText,
> "Move joystick to upper left");
> fl_suspend_timer(fd_joytest->timer1);
> js.buttons = 0;
> sleep(1);
>
> do{
> read(fd, &js, JS_RETURN);
> }while(js.buttons == 0);
>
> fl_resume_timer(fd_joytest->timer1);
> printf("Leaving calibrate.\n");
>
> }
>
> The timer is used to do the normal reading of the joystick. I even
> put
> the sleep(1) to allow time to display the message BEFORE entering the
> loop. But, teh message does not get displayed until AFTER a js button
> is
> pressed.
>
> Why????
>
> --
> Jeff Pierce
> piercej@preferred.com
> http://pages.preferred.com/~piercej
> _________________________________________________
> 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://bragg.phys.uwm.edu/xforms
> List Archive: http://bob.usuhs.mil/mailserv/list-archives/
>
>

=====

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
_________________________________________________
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://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/