- strncat(outp, "\0", 1);
-
- char *nl = outp;
- strcpy(nl, "");
- int old = 0;
- /* for (int i = 0; i < 255; i++) { */
- /* if (old != 0 && i > 0) { */
- /* for (int j = old; j <= i; j++) { */
- /* strncat(nl, outp, i - old); */
- /* } */
- /* } */
- /* if (outp[i] == '\n') */
- /* old = i; */
- /* } */
-
- // Display
+
+ // Strip empty newlines
+ char *nl = (char *) malloc(strlen(outp));
+ strncpy(nl, "\0", 1);
+ for (int i = 0; i < strlen(outp) - 1; i++) {
+ if (outp[i] == '\n' && outp[i+1] == '\n') i+=4;
+ strncat(nl, &outp[i], 1);
+ }
+
+ // Initialize motif
+ Widget toplevel;
+ XtAppContext app;
+ Widget text_w;
+ Arg args[4];
+
+ XtSetLanguageProc (NULL, NULL, NULL);
+ toplevel = XtVaOpenApplication (&app, "Castle Menu", NULL, 0, &argc, argv,
+ NULL, sessionShellWidgetClass, NULL);
+
+ // Set textbox settings