From: H.G. Muller Date: Sat, 31 Mar 2012 18:25:22 +0000 (+0200) Subject: Move DisplayMessage to dialogs.c X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=3b5c8a9ed7061c6aff8f897a74be47b853360163;p=xboard.git Move DisplayMessage to dialogs.c Use the wrapper SetWidgetLabel to make it back-end. --- diff --git a/dialogs.c b/dialogs.c index 03c56ea..0a48602 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1918,4 +1918,35 @@ BoardPopUp (int squareSize, int lineGap, void *clockFontThingy) return mainOptions; } +void +DisplayMessage (char *message, char *extMessage) +{ + /* display a message in the message widget */ + + char buf[MSG_SIZ]; + + if (extMessage) + { + if (*message) + { + snprintf(buf, sizeof(buf), "%s %s", message, extMessage); + message = buf; + } + else + { + message = extMessage; + }; + }; + + safeStrCpy(lastMsg, message, MSG_SIZ); // [HGM] make available + + /* need to test if messageWidget already exists, since this function + can also be called during the startup, if for example a Xresource + is not set up correctly */ + if(mainOptions[14].handle) + SetWidgetLabel(&mainOptions[14], message); + + return; +} + diff --git a/xboard.c b/xboard.c index fa5a4c4..4c96479 100644 --- a/xboard.c +++ b/xboard.c @@ -3178,41 +3178,6 @@ ManInner (Widget w, XEvent *event, String *prms, Cardinal *nprms) } void -DisplayMessage (char *message, char *extMessage) -{ - /* display a message in the message widget */ - - char buf[MSG_SIZ]; - Arg arg; - - if (extMessage) - { - if (*message) - { - snprintf(buf, sizeof(buf), "%s %s", message, extMessage); - message = buf; - } - else - { - message = extMessage; - }; - }; - - safeStrCpy(lastMsg, message, MSG_SIZ); // [HGM] make available - - /* need to test if messageWidget already exists, since this function - can also be called during the startup, if for example a Xresource - is not set up correctly */ - if(optList && optList[14].handle) - { - XtSetArg(arg, XtNlabel, message); - XtSetValues(optList[14].handle, &arg, 1); - }; - - return; -} - -void SetWindowTitle (char *text, char *title, char *icon) { Arg args[16];