X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=blobdiff_plain;f=src%2Fxio.c;h=f95790d534c73d6d855fb67c9ab1e0cfdda5c08f;hp=126da025166b1ba5de6ca7c9ea4a89f12f3814e7;hb=86f17194d065df99c2079102072cdcb1cfbc2339;hpb=f21d3481583b5cf877fc7b6efd6f2e08a1ade4b9 diff --git a/src/xio.c b/src/xio.c index 126da02..f95790d 100644 --- a/src/xio.c +++ b/src/xio.c @@ -1,4 +1,26 @@ +/* + * Problems with this code: + * 1. The text window behaves like it's only a few lines high, + * scrolling in response to Return when the insertion point + * is nowhere near the last line. + * 2. The attempt to insert text with XawTextReplace() core dumps. + * 3. I haven't found a way to write a callback that triggers on Return + * and yields the line before the return. The explanation at + * http://www.linuxjunkies.org/programming/GUI/xwindow/x11/text.html + * hints that this may be difficult. + * + * The functional goal is this: + * 1. Button pushes should be able to insert commands at the buffer's + * current insertion point. + * 2. When a user finishes a command with Return, a callback should + * receive the line of input typed. + * + * All the input passed to the game in back of this will be lines full + * of commands generated either by typing into the text buffer directly + * or by button presses that generate text unto the buffer. + */ #include +#include #include #include #include @@ -6,9 +28,9 @@ #include #include #include -#include "sst.h" - -#undef length /* ugh -- must get rid of ugly #defines */ +//#include "sst.h" +#define OPTION_PLANETS 1 +#define OPTION_PROBE 2 static XtAppContext app_context; static Widget toplevel, text, form;