XForms: Whats Wrong?

From: Serge B Bromow (serge@omensys.com)
Date: Sat Feb 26 2000 - 01:33:43 EST

  • Next message: T.C. Zhao: "Re: XForms: Whats Wrong?"

    # To subscribers of the xforms list from Serge B Bromow <serge@omensys.com> :

    OS = SCO OSR5
    XF = v.88

    APP = Simple test to read a serial touch screen controller. Callback is
    called when
    touch screen is touched.

    FORM = Has 2 buttons. 1 to test xforms(Ok), second to exit
    program(Exit).

    RESULT = Application starts and callback is called, even before
    data is available for reading on the port. When the touch screen is
    touched a memory fault occurs (no output to STDOUT).

    Any thoughts!
    --------------------------------------------------
    #include "forms.h"
    #include "cur.h"
    #include<standard.h>

    FD_cur *fd_cur;

    long l = 0;

    int main(int argc, char *argv[])
    {
    FL_IO_CALLBACK cxb();

    int fd;

    /* Open serial device for reading */
    if( (fd = open("/dev/srs011", READ)) == FAIL ) {
        printf("can't open touch screen\n");
        exit(PASS);
        }

    fl_initialize(&argc, argv, 0, 0, 0);
    fd_cur = create_form_cur();

    fl_add_io_callback(fd, FL_READ, cxb(), &l);

    /* show the first form */
    fl_show_form(fd_cur->cur,FL_PLACE_CENTERFREE,FL_FULLBORDER,"cur");

    fl_do_forms();
    return 0;
    }

    FL_IO_CALLBACK cxb( int fd, long *data)
    {
    char c;

    /* Show Entry to Callback */
    printf("touched, data = %ld\n", *data);

    /* Empty Queu */
    while( rdchk( fd ) > NULL ) {
        read(fd, &c, 512);
        }
    }
    -----------------------------------------------------
    Thanks for any help you can provide.

    Serge

    _________________________________________________
    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 : Sat Feb 26 2000 - 01:40:41 EST