Add optional full_window argument to TuiWindow.write

To prevent flickering when first calling erase, then write, this new
argument indicates that the passed string contains the full contents of
the window.  This fills every unused cell of the window with a space, so
it's not necessary to call erase beforehand.

gdb/ChangeLog:

2021-05-27  Hannes Domani  <ssbssa@yahoo.de>

	* python/py-tui.c (tui_py_window::output): Add full_window
	argument.
	(gdbpy_tui_write): Parse "full_window" argument.

gdb/doc/ChangeLog:

2021-05-27  Hannes Domani  <ssbssa@yahoo.de>

	* python.texi (TUI Windows In Python): Document "full_window"
	argument.
This commit is contained in:
Hannes Domani
2020-11-22 16:51:30 +01:00
parent d5a6313e1c
commit bdef572304
4 changed files with 30 additions and 7 deletions

View File

@ -5959,10 +5959,14 @@ displayed above the window. This attribute can be modified.
Remove all the contents of the window.
@end defun
@defun TuiWindow.write (@var{string})
@defun TuiWindow.write (@var{string} @r{[}, @var{full_window}@r{]})
Write @var{string} to the window. @var{string} can contain ANSI
terminal escape styling sequences; @value{GDBN} will translate these
as appropriate for the terminal.
If the @var{full_window} parameter is @code{True}, then @var{string}
contains the full contents of the window. This is similar to calling
@code{erase} before @code{write}, but avoids the flickering.
@end defun
The factory function that you supply should return an object