# HG changeset patch
# Node ID b35c53a86931
# Parent  1819a3f27516
diff --git a/demo/data/demo.ui b/demo/data/demo.ui
--- a/demo/data/demo.ui
+++ b/demo/data/demo.ui
@@ -34,11 +34,13 @@
         <property name="wide-handle">1</property>
         <child>
           <object class="TalkatuScrolledWindow">
-            <child>
-              <object class="TalkatuHistory" id="history">
-                <property name="name">history</property>
-                <property name="hexpand-set">True</property>
-                <property name="vexpand-set">True</property>
+            <child internal-child="scrolled_window">
+              <object class="GtkScrolledWindow" id="scrolled_window">
+                <child>
+                  <object class="TalkatuHistory" id="history">
+                    <property name="name">history</property>
+                  </object>
+                </child>
               </object>
             </child>
           </object>
diff --git a/talkatu/data/scrolledwindow.ui b/talkatu/data/scrolledwindow.ui
--- a/talkatu/data/scrolledwindow.ui
+++ b/talkatu/data/scrolledwindow.ui
@@ -5,11 +5,11 @@
     <child>
       <object class="GtkScrolledWindow" id="scrolled_window">
         <property name="vexpand">1</property>
+        <property name="hexpand">1</property>
         <property name="focusable">1</property>
         <property name="vadjustment">vadjustment</property>
-        <child>
-          <placeholder/>
-        </child>
+        <property name="min-content-height">150</property>
+        <property name="vscrollbar-policy">2</property>
       </object>
     </child>
   </template>
diff --git a/talkatu/talkatuscrolledwindow.c b/talkatu/talkatuscrolledwindow.c
--- a/talkatu/talkatuscrolledwindow.c
+++ b/talkatu/talkatuscrolledwindow.c
@@ -76,31 +76,6 @@
 }
 
 /******************************************************************************
- * GtkBuildable Implementation
- *****************************************************************************/
-static GtkBuildableIface *parent_buildable_iface = NULL;
-
-static void
-talkatu_scrolled_window_build_add_child(GtkBuildable *buildable,
-                                        GtkBuilder *builder, GObject *child,
-                                        const gchar *type)
-{
-	if(GTK_IS_WIDGET(child)) {
-		talkatu_scrolled_window_set_child(TALKATU_SCROLLED_WINDOW(buildable),
-		                                  GTK_WIDGET(child));
-	} else {
-		parent_buildable_iface->add_child(buildable, builder, child, type);
-	}
-}
-
-static void
-talkatu_scrolled_window_buildable_init(GtkBuildableIface *iface) {
-	parent_buildable_iface = g_type_interface_peek_parent(iface);
-
-	iface->add_child = talkatu_scrolled_window_build_add_child;
-}
-
-/******************************************************************************
  * GObject Implementation
  *****************************************************************************/
 G_DEFINE_TYPE(TalkatuScrolledWindow, talkatu_scrolled_window, GTK_TYPE_WIDGET)
@@ -138,6 +113,15 @@
 }
 
 static void
+talkatu_scrolled_window_dispose(GObject *obj) {
+	TalkatuScrolledWindow *sw = TALKATU_SCROLLED_WINDOW(obj);
+
+	g_clear_pointer(&sw->scrolled_window, gtk_widget_unparent);
+
+	G_OBJECT_CLASS(talkatu_scrolled_window_parent_class)->dispose(obj);
+}
+
+static void
 talkatu_scrolled_window_init(TalkatuScrolledWindow *sw) {
 	gtk_widget_init_template(GTK_WIDGET(sw));
 
@@ -151,6 +135,7 @@
 
 	obj_class->get_property = tatlkatu_scrolled_window_get_property;
 	obj_class->set_property = tatlkatu_scrolled_window_set_property;
+	obj_class->dispose = talkatu_scrolled_window_dispose;
 
 	/**
 	 * TalkatuScrolledWindow::child:
@@ -170,8 +155,9 @@
 		"/org/imfreedom/keep/talkatu/talkatu/ui/scrolledwindow.ui"
 	);
 
-	gtk_widget_class_bind_template_child(widget_class, TalkatuScrolledWindow,
-	                                     scrolled_window);
+	gtk_widget_class_bind_template_child_internal(widget_class,
+	                                              TalkatuScrolledWindow,
+	                                              scrolled_window);
 	gtk_widget_class_bind_template_child(widget_class, TalkatuScrolledWindow,
 	                                     vadjustment);
 
