asciiTextWidget problem - Xwindows

This is a discussion on asciiTextWidget problem - Xwindows ; I'm running into a problem using Xaw in a program I'm trying to write (I'm using Xaw since it's available just about everywhere) I'm using an asciiTextWidget to display messages from the app that slowly scroll by as things happen, ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: asciiTextWidget problem

  1. asciiTextWidget problem

    I'm running into a problem using Xaw in a program I'm trying to write
    (I'm using Xaw since it's available just about everywhere)

    I'm using an asciiTextWidget to display messages from the app that
    slowly scroll by as things happen, and I usually want the widget to show
    the end of the buffer where the most current messages are. As new
    messages arrive, it should scroll forward.

    Is there a good way to reliably get an asciiTextWidget to always scroll
    to the bottom of it's buffer automatically?

    I've tried using these 2 calls, and it partially works:

    XtCallActionProc(w, "end-of-file", NULL, NULL, 0);
    XtCallActionProc(w, "end-of-line", NULL, NULL, 0);

    But if the widget has word wrap turned on, it sometiems jumps to the
    start of the last line, but there's still more text below it that
    doesn't get displayed. I've been searching around other sites trying to
    find anything that might work, but so far I'm stuck.


  2. Re: asciiTextWidget problem



    Paul Vojta wrote:
    > In article <40B79077.3000207@xilinx.com>,
    > Carl Norden wrote:
    >
    >>I'm using an asciiTextWidget to display messages from the app that
    >>slowly scroll by as things happen, and I usually want the widget to show
    >>the end of the buffer where the most current messages are. As new
    >>messages arrive, it should scroll forward.
    >>
    >>Is there a good way to reliably get an asciiTextWidget to always scroll
    >>to the bottom of it's buffer automatically?
    >>
    >>I've tried using these 2 calls, and it partially works:
    >>
    >> XtCallActionProc(w, "end-of-file", NULL, NULL, 0);
    >> XtCallActionProc(w, "end-of-line", NULL, NULL, 0);
    >>
    >>But if the widget has word wrap turned on, it sometiems jumps to the
    >>start of the last line, but there's still more text below it that
    >>doesn't get displayed. I've been searching around other sites trying to
    >>find anything that might work, but so far I'm stuck.

    >
    >
    > Have you tried:
    >
    > XawTextSetInsertionPoint(w, length);
    >
    > where length is the (current) number of bytes in the display buffer.
    > This would have to be done every time you add bytes to the buffer,
    > so it may not be what you want (i.e., "automatically").


    I just gave that a try, no luck.. I can see the caret at the end of the
    buffer, so it's there already, but it just doesn't want to scroll all
    the way down automatically if word wrapping is turned on.


  3. Re: asciiTextWidget problem

    In article <40B79077.3000207@xilinx.com>,
    Carl Norden wrote:
    >I'm using an asciiTextWidget to display messages from the app that
    >slowly scroll by as things happen, and I usually want the widget to show
    >the end of the buffer where the most current messages are. As new
    >messages arrive, it should scroll forward.
    >
    >Is there a good way to reliably get an asciiTextWidget to always scroll
    >to the bottom of it's buffer automatically?
    >
    >I've tried using these 2 calls, and it partially works:
    >
    > XtCallActionProc(w, "end-of-file", NULL, NULL, 0);
    > XtCallActionProc(w, "end-of-line", NULL, NULL, 0);
    >
    >But if the widget has word wrap turned on, it sometiems jumps to the
    >start of the last line, but there's still more text below it that
    >doesn't get displayed. I've been searching around other sites trying to
    >find anything that might work, but so far I'm stuck.


    Have you tried:

    XawTextSetInsertionPoint(w, length);

    where length is the (current) number of bytes in the display buffer.
    This would have to be done every time you add bytes to the buffer,
    so it may not be what you want (i.e., "automatically").

    --Paul Vojta, vojta@math.berkeley.edu

  4. Re: asciiTextWidget problem



    Paul Vojta wrote:
    >
    > In article <40B79077.3000207@xilinx.com>,
    > Carl Norden wrote:
    > >I'm using an asciiTextWidget to display messages from the app that
    > >slowly scroll by as things happen, and I usually want the widget to show
    > >the end of the buffer where the most current messages are. As new
    > >messages arrive, it should scroll forward.
    > >
    > >Is there a good way to reliably get an asciiTextWidget to always scroll
    > >to the bottom of it's buffer automatically?
    > >
    > >I've tried using these 2 calls, and it partially works:
    > >
    > > XtCallActionProc(w, "end-of-file", NULL, NULL, 0);
    > > XtCallActionProc(w, "end-of-line", NULL, NULL, 0);
    > >
    > >But if the widget has word wrap turned on, it sometiems jumps to the
    > >start of the last line, but there's still more text below it that
    > >doesn't get displayed. I've been searching around other sites trying to
    > >find anything that might work, but so far I'm stuck.

    >
    > Have you tried:
    >
    > XawTextSetInsertionPoint(w, length);
    >
    > where length is the (current) number of bytes in the display buffer.
    > This would have to be done every time you add bytes to the buffer,
    > so it may not be what you want (i.e., "automatically").
    >
    > --Paul Vojta, vojta@math.berkeley.edu


    try setting scrollbar values:

    XtVaGetValues( vscroll, XmNmaximum, &maxval, NULL);
    XmScrollBarGetValues( vscroll, &value, &size, &incr, &pincr );
    XmScrollBarSetValues( vscroll, (maxval-size), size, incr, pincr, True
    );
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Common User Interface Services
    M/S 2R-94 (206)544-5225

+ Reply to Thread