void
DelayedSetText ()
{
- SetWidgetText(&chatOptions[CHAT_IN], tmpLine, ChatDlg);
+ SetWidgetText(&chatOptions[CHAT_IN], tmpLine, -1); // leave focus on chat-partner field!
SetInsertPos(&chatOptions[CHAT_IN], strlen(tmpLine));
}
{
int i, j;
char *v;
+ if(chatOptions[CHAT_ICS].type == Skip) hidden = 0; // In Xaw there is no ICS pane we can hide behind
Show(&chatOptions[CHAT_PANE], 0); // show
if(hidden) ScheduleDelayedEvent(DelayedScroll, 50); // Awful!
else ScheduleDelayedEvent(DelayedSetText, 50);
void
ConsoleWrite(char *message, int count)
{
- if(shellUp[ChatDlg]) {
+ if(shellUp[ChatDlg] && chatOptions[CHAT_ICS].type != Skip) { // in Xaw this is a no-op
AppendColorized(&chatOptions[CHAT_ICS], message, count);
SetInsertPos(&chatOptions[CHAT_ICS], 999999);
}
{
static int line = 0;
ChildProc *cp = (ChildProc *) pr;
- int outCount;
+ int outCount = count;
if (pr == NoProc)
{
char *p;
int forceMono = False;
+ extern Option chatOptions[]; // FIXME: adapt Chat window, removing ICS pane and Hide button
+ chatOptions[6].type = chatOptions[10].type = Skip;
+
srandom(time(0)); // [HGM] book: make random truly random
setbuf(stdout, NULL);
void
AppendColorized (Option *opt, char *message, int count)
{
+ if(!opt->handle) return;
AppendText(opt, message);
}
void
Show (Option *opt, int hide)
{
+ static Dimension h;
+ Arg args[16];
+ Dimension v;
+ int j=0;
+return; // FIXME: it would be nice if the Chat window did have an ICS pane we could hide behind
+printf("Show(%d) %x\n", hide, opt->handle);
+ if(!opt->handle) return;
+ if(hide) { // make sure original size is saved
+ XtSetArg(args[j], XtNheight, &v); j++;
+ XtGetValues(opt->handle, args, j);
+ if(v != 1) h = v;
+ }
+printf("h = %d\n",h);
+ j = 0;
+ XtSetArg(args[j], XtNheight, hide ? 1 : h); j++;
+ XtSetValues(opt->handle, args, j);
}
void