+2021-06-04 Hannes Domani <ssbssa@yahoo.de>
+
+ * python/py-tui.c (class tui_py_window): Add click function.
+ (tui_py_window::click): Likewise.
+
2021-06-04 Hannes Domani <ssbssa@yahoo.de>
* ser-mingw.c (console_select_thread): Handle MOUSE_EVENT.
+2021-06-04 Hannes Domani <ssbssa@yahoo.de>
+
+ * python.texi (TUI Windows In Python): Document Window.click.
+
2021-05-29 Hannes Domani <ssbssa@yahoo.de>
* python.texi (Writing a Frame Filter): Fix example.
and so the content should appear to move up.
@end defun
+@defun Window.click (@var{x}, @var{y}, @var{button})
+This is called on a mouse click in this window. @var{x} and @var{y} are
+the mouse coordinates inside the window (0-based), and @var{button}
+specifies which mouse button was used, whose values can be 1 (left),
+2 (middle), or 3 (right).
+@end defun
+
@node Python Auto-loading
@subsection Python Auto-loading
@cindex Python auto-loading
tui_win_info::refresh_window ();
}
+ void click (int mouse_x, int mouse_y, int mouse_button) override;
+
/* Erase and re-box the window. */
void erase ()
{
}
}
+void
+tui_py_window::click (int mouse_x, int mouse_y, int mouse_button)
+{
+ gdbpy_enter enter_py (get_current_arch (), current_language);
+
+ if (PyObject_HasAttrString (m_window.get (), "click"))
+ {
+ gdbpy_ref<> result (PyObject_CallMethod (m_window.get (), "click",
+ "iii", mouse_x, mouse_y,
+ mouse_button));
+ if (result == nullptr)
+ gdbpy_print_stack ();
+ }
+}
+
void
tui_py_window::output (const char *text, bool full_window)
{