Scrolled window prob

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

Questions about motif? Contact us

3 posts / 0 new
Last post
Scrolled window prob

Submitted by Anonymous (not verified) on Fri, 06/15/2012 - 12:07

I`m new to this Motif programming thing, and I`m attempting to develop a "Desktop Korn Shell" script application. One of the requirements is for a "Status Window" where messages from the script can be displayed, the messages can be explicitly output by the script or just be the "tail" of a log file, the source of the messages is not really the issue.
I`ve started with setting up a "XmScrolledWindow" which is the parent of an "XmText" primitive? is this OK? and what mechanism should I be using to update it XtSetValues, XmTextSetString, XmNsource?
It seems to me that this sort of thing should be fairly easy to setup but working through the Xt Intrinsics and Motif manuals just presents me with a bewildering array of "stuff" to try and decipher.
I consider that I`m professional enough to know when I need some assistance so, can anyone point me in the direction of some (preferably dtksh) examples I can pick apart or provide me with solution to this.
Thanks in advance.
Paul Will
‹ Tab Widgets ( Windows like ) XtPopdown requires a subclass of shellWidgetClass ›

Anonymous

Mon, 11/10/2003 - 13:55#1

Scrolled window prob

Paul,

Try this code.

Widget scroll, text, parent;

// Create scrolled window parent & text child
scroll= XtVaCreateManagedWidget
("scrolled", xmScrolledWindowWidgetClass,
parent,
XmNheight, 250,
XmNscrollingPolicy, XmAPPLICATION_DEFINED,
NULL);

text = XtVaCreateManagedWidget
("text", xmTextWidgetClass,
scroll,
XmNeditMode, XmMULTI_LINE_EDIT,
XmNeditable, False,
XmNwordWrap, True,
XmNcursorPositionVisible, False,
NULL);
.
.
.
// Write to scrolled text
XmTextPosition pos;

// Get last text position and start
// inserting there.
pos = XmTextGetLastPosition(text);
XmTextInsert (text, pos, (char *)msg);

// Scroll the newly inserted text into view
XmTextShowPosition(text, pos);

Bob

ICS_support

Fri, 11/14/2003 - 20:55#2

Scrolled window prob

XmScrolledText probably does what you want. See XmText for primitives to update the text. The XmCommand may also work for you.

The visual shell you mention probably already exists, by the way.