projects
/
super-star-trek.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
438dc2b
)
Text append looks like it should work, but it core-dumps.
author
Eric S. Raymond
<esr@thyrsus.com>
Thu, 14 Sep 2006 18:25:06 +0000
(18:25 +0000)
committer
Eric S. Raymond
<esr@thyrsus.com>
Thu, 14 Sep 2006 18:25:06 +0000
(18:25 +0000)
src/xio.c
patch
|
blob
|
history
diff --git
a/src/xio.c
b/src/xio.c
index ea35fb1b9ee266cc2ad7599cbc25d4af5caf986e..126da025166b1ba5de6ca7c9ea4a89f12f3814e7 100644
(file)
--- a/
src/xio.c
+++ b/
src/xio.c
@@
-8,6
+8,8
@@
#include <X11/Xaw/AsciiText.h>
#include "sst.h"
#include <X11/Xaw/AsciiText.h>
#include "sst.h"
+#undef length /* ugh -- must get rid of ugly #defines */
+
static XtAppContext app_context;
static Widget toplevel, text, form;
static Widget navigation, weapons, planets, misc;
static XtAppContext app_context;
static Widget toplevel, text, form;
static Widget navigation, weapons, planets, misc;
@@
-56,10
+58,25
@@
static void quit_proc(Widget w, XtPointer client_data, XtPointer call_data)
exit (0);
}
exit (0);
}
+static void text_append_to(Widget w, String str)
+/* append text to a specified text widget */
+{
+ XawTextBlock txtblk;
+ XawTextPosition textend = XawTextGetInsertionPoint(w);
+
+ txtblk.ptr = str;
+ txtblk.length = strlen(str);
+ txtblk.firstPos = 0;
+ txtblk.format = FMT8BIT;
+
+ XawTextReplace(w, textend, textend, &txtblk);
+}
+
static void noargs_proc(Widget w, XtPointer client_data, XtPointer call_data)
/* use this for commands that take no arguments */
{
/* currently a stub */
static void noargs_proc(Widget w, XtPointer client_data, XtPointer call_data)
/* use this for commands that take no arguments */
{
/* currently a stub */
+ text_append_to(w, XtName(w));
printf("Button %s pressed\n", XtName(w));
}
printf("Button %s pressed\n", XtName(w));
}