From aaf96ab501f948df13f78fdf072379884d2d3f2e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 18 May 2006 19:48:03 +0000 Subject: Add TXT_SetDesktopTitle() Subversion-branch: /trunk/chocolate-doom Subversion-revision: 482 --- textscreen/guitest.c | 3 ++- textscreen/txt_window.c | 15 ++++++++++++++- textscreen/txt_window.h | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'textscreen') diff --git a/textscreen/guitest.c b/textscreen/guitest.c index b4cd8df5..d65aa67c 100644 --- a/textscreen/guitest.c +++ b/textscreen/guitest.c @@ -56,6 +56,7 @@ void Window2(void) int main() { TXT_Init(); + TXT_SetDesktopTitle("Not Chocolate Doom Setup"); Window2(); SetupWindow(); @@ -64,7 +65,7 @@ int main() { firstwin->selected = (firstwin->selected + 1) % firstwin->num_widgets; - TXT_DrawAllWindows(); + TXT_DrawAllWindows(); } } diff --git a/textscreen/txt_window.c b/textscreen/txt_window.c index ce58aaa3..cc467192 100644 --- a/textscreen/txt_window.c +++ b/textscreen/txt_window.c @@ -31,6 +31,7 @@ #define MAXWINDOWS 128 +static char *desktop_title; static txt_window_t *all_windows[MAXWINDOWS]; static int num_windows = 0; @@ -152,11 +153,23 @@ static void DrawWindow(txt_window_t *window) TXT_DrawSeparator(window_x, window_y + 2 + window->num_widgets, window_w); } +void TXT_SetDesktopTitle(char *title) +{ + free(desktop_title); + desktop_title = strdup(title); +} + void TXT_DrawAllWindows(void) { int i; + char *title; + + if (desktop_title == NULL) + title = ""; + else + title = desktop_title; - TXT_DrawDesktop("Not Chocolate Doom setup"); + TXT_DrawDesktop(title); for (i=0; i