XmScrolledText : page up and page down ? - Motif

This is a discussion on XmScrolledText : page up and page down ? - Motif ; I have a read-only ( XmEditable set to false) Scrolled Text widget. This is part of a form containing a scrolled list and some labels. I can select text from the ScrolledText, and the scroll bars work fine. However, the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: XmScrolledText : page up and page down ?

  1. XmScrolledText : page up and page down ?

    I have a read-only ( XmEditable set to false) Scrolled Text widget. This is
    part of a form containing a scrolled list and some labels.

    I can select text from the ScrolledText, and the scroll bars work fine.

    However, the page/up and page-down keyboartd kest , as well as arrow up and
    down do not work.

    Is this normal behaviour in a read-only text widget ?

    or must I somehow tell the system that the focus is on the scrolled text so
    that keyboard events will go to it and it can then translate a page-up/down
    into appropriate scrolling commands ?

    Also, in a semi-related question: If I XmTextSetString the widget with a 64k
    string, and then I XmTextSetString a 4k string, does the widget automatically
    deallocate whatever storage it had allocated to hold its working copy of the
    old 64k string ?

  2. Re: XmScrolledText : page up and page down ?

    JF Mezei wrote in message news:<3FAF78A2.89BD86DA@istop.com>...
    > I have a read-only ( XmEditable set to false) Scrolled Text widget. This is
    > part of a form containing a scrolled list and some labels.
    >
    > I can select text from the ScrolledText, and the scroll bars work fine.
    >
    > However, the page/up and page-down keyboartd kest , as well as arrow up and
    > down do not work.
    >
    > Is this normal behaviour in a read-only text widget ?


    No.

    > or must I somehow tell the system that the focus is on the scrolled text so
    > that keyboard events will go to it and it can then translate a page-up/down
    > into appropriate scrolling commands ?


    Yes. If the text doesn't have the keyboard focus it will not receive the
    keyboard events.

    > Also, in a semi-related question: If I XmTextSetString the widget with a 64k
    > string, and then I XmTextSetString a 4k string, does the widget automatically
    > deallocate whatever storage it had allocated to hold its working copy of the
    > old 64k string ?


    If you set the contents to a smaller amount of text the memory pool will not
    shrink, but the unused space will be used later if needed.

    -- Casantos

  3. Re: XmScrolledText : page up and page down ?

    Carlos A M dos Santos wrote:
    > Yes. If the text doesn't have the keyboard focus it will not receive the
    > keyboard events.


    Thanks. Turns out I am having problems with TWM giving focus to the right
    window and the page-up/down were being sent to an underlying window still
    having focus :-( By insisting the topmost window has focus, the page-up and
    page down keys worked, but required I first click on the scrolled text area (a
    logical thing).

    Thanks for the response.

+ Reply to Thread