+2002-08-24 Stephane Carrez <stcarrez@nerim.fr>
+
+ * tuiWin.c (tui_update_gdb_sizes): New function to tell gdb what
+ is the size of command window.
+ (tuiResizeAll): Call it instead of init_page_info.
+ * tui.c (tui_enable): Call it to resize to TUI command window.
+ (tui_disable): Likewise for plain screen.
+
2002-08-24 Stephane Carrez <stcarrez@nerim.fr>
* tui.c (tui_enable): Use tuiSetLayout instead of showLayout and
#include "breakpoint.h"
#include "frame.h"
#include "cli/cli-cmds.h"
+#include "top.h"
#include "tui.h"
#include "tuiData.h"
#include "tuiSourceWin.h"
#include "tuiDataWin.h"
-/*******************************
-** External Declarations
-********************************/
-extern void init_page_info ();
-
/*******************************
** Static Local Decls
********************************/
add_show_from_set (c, &tui_showlist);
}
+/* Update gdb's knowledge of the terminal size. */
+void
+tui_update_gdb_sizes ()
+{
+ char cmd[50];
+ extern int screenheight, screenwidth; /* in readline */
+
+ /* Set to TUI command window dimension or use readline values. */
+ sprintf (cmd, "set width %d",
+ tui_active ? cmdWin->generic.width : screenwidth);
+ execute_command (cmd, 0);
+ sprintf (cmd, "set height %d",
+ tui_active ? cmdWin->generic.height : screenheight);
+ execute_command (cmd, 0);
+}
+
/*
** tuiSetWinFocusTo
/* turn keypad off while we resize */
if (winWithFocus != cmdWin)
keypad (cmdWin->generic.handle, FALSE);
- init_page_info ();
+ tui_update_gdb_sizes ();
setTermHeightTo (screenheight);
setTermWidthTo (screenwidth);
if (curLayout == SRC_DISASSEM_COMMAND ||
warning ("Invalid window height specified.\n%s",
WIN_HEIGHT_USAGE);
else
- init_page_info ();
+ tui_update_gdb_sizes ();
}
else
warning ("Invalid window height specified.\n%s",