X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fxio.c;h=6d604909d1fe150a5444b97c0c950f01d405040d;hb=ebc4fdc3802c47c9fe7ec31b4cde062faff366fc;hp=65098bff143e10b05708bff793cb5f15501034e2;hpb=0bc4964e6bcf3a3ee3b383ee79a97f69ffa48b46;p=super-star-trek.git diff --git a/src/xio.c b/src/xio.c index 65098bf..6d60490 100644 --- a/src/xio.c +++ b/src/xio.c @@ -18,6 +18,10 @@ static String fallback[] = { "*text.resize: ResizeBoth", "*text.width: 640", "*text.height: 200", + "*text.autoFill: True", + "*text.scrollVertical: Always", + "*text.scrollHorizontal: WhenNeeded", + "*text.displayCaret: True", "*navigation.fromVert: text", "*navigation.borderWidth: 0", "*navlabel.label: Navigation: ", @@ -52,10 +56,25 @@ static void quit_proc(Widget w, XtPointer client_data, XtPointer call_data) 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 */ + text_append_to(w, XtName(w)); printf("Button %s pressed\n", XtName(w)); } @@ -106,7 +125,6 @@ static void instantiate_main(int argc, char **argv) text = XtVaCreateManagedWidget("text", asciiTextWidgetClass, form, XtNeditType, XawtextEdit, - XtNdisplayCaret,False, NULL); /* The button panels */ navigation = XtVaCreateManagedWidget("navigation",