[PATCH 20/24] Allow TUI windows in Python

Eli Zaretskii eliz@gnu.org
Sat Jan 4 18:57:00 GMT 2020


> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>
> Date: Sat,  4 Jan 2020 11:34:06 -0700
> 
> 2020-01-04  Tom Tromey  <tom@tromey.com>
> 
> 	* NEWS: Add entry for gdb.register_window_type.
> 	* tui/tui-layout.h (window_factory): New typedef.
> 	(tui_register_window): Declare.
> 	* tui/tui-layout.c (saved_tui_windows): New global.
> 	(tui_apply_current_layout): Use it.
> 	(tui_register_window): New function.
> 	* python/python.c (do_start_initialization): Call
> 	gdbpy_initialize_tui.
> 	(python_GdbMethods): Add "register_window_type" function.
> 	* python/python-internal.h (gdbpy_register_tui_window)
> 	(gdbpy_initialize_tui): Declare.
> 	* python/py-tui.c: New file.
> 	* Makefile.in (SUBDIR_PYTHON_SRCS): Add py-tui.c.
> 
> gdb/doc/ChangeLog
> 2020-01-04  Tom Tromey  <tom@tromey.com>
> 
> 	* python.texi (Python API): Add menu item.
> 	(TUI Windows In Python): New node.
> 
> gdb/testsuite/ChangeLog
> 2020-01-04  Tom Tromey  <tom@tromey.com>
> 
> 	* gdb.python/tui-window.exp: New file.
> 	* gdb.python/tui-window.py: New file.

OK for the documentation parts, with two comments.

> +terminal escape styling sequences; @value{GDBN} will convert translate
> +these as appropriate for the terminal.               ^^^^^^^^^^^^^^^^^

One of these two words should be removed.

> +@defun Window.hscroll (@var{num})
> +This is a request to scroll the window horizontally.  @var{num} is the
> +amount by which to scroll, with negative numbers meaning to scroll
> +right.
> +@end defun
> +
> +@defun Window.vscroll (@var{num})
> +This is a request to scroll the window vertically.  @var{num} is the
> +amount by which to scroll, with negative numbers meaning to scroll
> +backward.

There's a well-known source of confusion with describing scrolling
direction: does it refer to scrolling of the text in the window
(i.e. the window is considered to be fixed and the text to be
scrolled) or the other way around?  The confusion stems from the fact
that we say "scroll the window", but what is actually scrolled is the
text.  Can we please make it crystal clear here what will move right
and backward here?

Thanks.



More information about the Gdb-patches mailing list