[gtksourceview/wip/gtk-buildable] view: add internal-children "left_gutter" and "right_gutter"
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/gtk-buildable] view: add internal-children "left_gutter" and "right_gutter"
- Date: Fri, 12 Sep 2014 19:22:46 +0000 (UTC)
commit 09bce822f9f11ef12b39777ed00cc0e47ea32d2d
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Sep 12 19:44:43 2014 +0200
view: add internal-children "left_gutter" and "right_gutter"
TODO:
- in a .ui file, be able to add renderers in a Gutter object (the
position needs to be specified). And with an id="my_renderer", it should
be possible to use
gtk_widget_class_bind_template_child_internal_private() to access the
renderer in the code.
gtksourceview/gtksourceview.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index b14df66..d804482 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -60,7 +60,9 @@
* # GtkSourceView as GtkBuildable
*
* The GtkSourceView implementation of the #GtkBuildable interface exposes the
- * #GtkSourceView:completion object with the internal-child "completion".
+ * #GtkSourceView:completion object with the internal-child "completion". The
+ * gutters are exposed with the internal-child "left_gutter" and "right_gutter"
+ * (see gtk_source_view_get_gutter()).
*
* An example of a UI definition fragment with GtkSourceView:
* |[
@@ -780,6 +782,14 @@ gtk_source_view_buildable_get_internal_child (GtkBuildable *buildable,
{
return G_OBJECT (gtk_source_view_get_completion (view));
}
+ if (g_strcmp0 (childname, "left_gutter") == 0)
+ {
+ return G_OBJECT (gtk_source_view_get_gutter (view, GTK_TEXT_WINDOW_LEFT));
+ }
+ if (g_strcmp0 (childname, "right_gutter") == 0)
+ {
+ return G_OBJECT (gtk_source_view_get_gutter (view, GTK_TEXT_WINDOW_RIGHT));
+ }
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]