[gtksourceview/wip/chergert/hoverers] show hover word from test providier
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/hoverers] show hover word from test providier
- Date: Tue, 9 Mar 2021 22:53:55 +0000 (UTC)
commit b8be98d4d69ee9762a5971ee1711e02aad32e68e
Author: Christian Hergert <chergert redhat com>
Date: Tue Mar 9 14:53:51 2021 -0800
show hover word from test providier
tests/test-widget.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/tests/test-widget.c b/tests/test-widget.c
index fef8f5c6..ec00016c 100644
--- a/tests/test-widget.c
+++ b/tests/test-widget.c
@@ -1163,6 +1163,16 @@ test_hover_provider_populate (GtkSourceHoverProvider *provider,
GtkSourceHoverDisplay *display,
GError **error)
{
+ GtkTextIter begin, end;
+
+ if (gtk_source_hover_context_get_bounds (context, &begin, &end))
+ {
+ gchar *text = gtk_text_iter_get_slice (&begin, &end);
+ GtkWidget *label = gtk_label_new (text);
+ gtk_source_hover_display_append (display, label);
+ g_free (text);
+ }
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]