[comp.windows.x] Increasing the buffer size of an AsciiStringWidget

jlevy@arisia.Xerox.COM (Jacob Levy) (02/22/89)

Suppose I wanted to have an AsciiStringWidget with a buffer that
I supply, through the XtNstring and XtNlength resources. Later
on, I want to reallocate the buffer to a new size, and inform the
widget with XtSetValues. Trying this yields a complaint from the
X toolkit that XtSetValues is not supported for
AsciiStringWidgets.

Is there any other way to do what I am trying to do? As usual,
source code is greatly appreciated.

--Jacob

swick@ATHENA.MIT.EDU (Ralph R Swick) (02/22/89)

Needs a fix to the AsciiStringWidget.  The proper fix (to the Text widget)
is fairly lengthy and won't happen before X11R4.  A quick fix is possible
inside AsciiString.SetValues, by destroying and re-creating the
string source.  In fact, you should be able to do this yourself
by calling XtStringSourceCreate and then doing XtSetValues on XtNsource.
To avoid a memory leak, you should also retrieve the old source and
call XtStringSourceDestroy.

XtStringSourceCreate is documented (poorly :-( in the Athena Widgets
manual.  The resources are the obvious subset of the AsciiText resources.