Scroll a "text area"

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Scroll a "text area"

Submitted by Anonymous (not verified) on

Fri, 06/15/2012 - 12:07

Hi,
Excuse my poor English.
I have a "text area" with a scroll (vertical an horizontal).
I am receiving messages continuously and I display them in the text area.
But it arrives a little while in which the first messages disappear of the text area. I suppose that a maximum in the line number or characters stored is reached.
How I can form this?
How I can set this?
Thanks a lot.
‹ Main window location without decoration Geeting issue with pull bar menu ›

 

Thu, 11/02/2006 - 17:14#1

Thu, 11/02/2006 - 17:14#1

Submitted by yahubat on

Mon, 07/16/2012 - 13:16

Thu, 11/02/2006 - 17:14#1

Yuriy Syrota

Scroll a "text area"

Could you post a simple example that shows the issue?

 

Wed, 03/07/2007 - 19:31#2

Wed, 03/07/2007 - 19:31#2

Submitted by yahubat on

Mon, 07/16/2012 - 13:17

Wed, 03/07/2007 - 19:31#2

guiqueen

Re: Scroll a "text area"

You may want to try using a scrolledText widget in MainWindow widget.

By placing a scrolledText widget in the Message Window, you can send multiple messages to this area, and the user will be able to scroll up and see all the messages. This way you will see scrolled text as the Main Window's message window.

The following function takes one argument, the Main Window`s widget ID, and creates a scrolledText widget, using the external variable messageWidget. It then puts that widget in the XmNmessageWindow resource of the Main Window widget.

extern Widget messageWidget;

void CreateMessageWindowWidget(main_win_widget)
Widget main_win_widget;
{
messageWidget = XmCreateScrolledText (main_win_widget
"messageWidget", NULL, 0);
XtVaSetValues(messageWidget,
XmNtraversalOn, False,
XmNcursorPositionVisible, False,
XmNwordWrap, True,
XmNscrollHorizontal, False,
XmNeditMode, XmMULTI_LINE_EDIT,
XmNeditable, False,
NULL);
XtManageChild(messageWidget);

/* put scrolled text in the messageWindow resource of the Main
Window */
XtVaSetValues(main_win_widget,
XmNmessageWindow, XtParent(messageWidget),
NULL);
}