[gtksourceview/wip/gtk-buildable] view: add internal-children "left_gutter" and "right_gutter"



commit 7845db77b6946727500686321be61ddd897c9578
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"
    
    But I don't know why it is useful to access those objects in a .ui file,
    as the xpad and ypad properties are deprecated.

 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]