[gtkmm-documentation] Update the Custom Containers section



commit 396b4a41e0965b9fd4dfa8299b8b4924eb90ed05
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Tue Aug 2 18:27:13 2022 +0200

    Update the Custom Containers section
    
    Mention that the container must unparent its children.
    Also update the figure in the section.

 docs/tutorial/C/figures/custom_container.png | Bin 10356 -> 18359 bytes
 docs/tutorial/C/index-in.docbook             |  11 ++++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/docs/tutorial/C/figures/custom_container.png b/docs/tutorial/C/figures/custom_container.png
index 6b105d9..fdc3457 100644
Binary files a/docs/tutorial/C/figures/custom_container.png and 
b/docs/tutorial/C/figures/custom_container.png differ
diff --git a/docs/tutorial/C/index-in.docbook b/docs/tutorial/C/index-in.docbook
index b07f37d..f7fc3b4 100644
--- a/docs/tutorial/C/index-in.docbook
+++ b/docs/tutorial/C/index-in.docbook
@@ -7037,10 +7037,19 @@ instance, you cannot use the copyright sign (&copy;).
        widgets to fill the space, or you might choose to expand the padding
        between your widgets. It's your container, so you decide.</para>
 
+   <para>Your container must unparent its children before the underlying C object
+       (a <classname>gtkmm__GtkWidget</classname>) is finalized. If your container
+       is used as a managed widget, it shall unparent its children in a
+       <methodname>Gtk::Widget::signal_destroy()</methodname> handler (available
+       since &gtkmm; 4.8.0). If your container is not managed, that signal handler
+       is not called. Instead the children shall be unparented in the C++ destructor.
+       If you want your container to be useful both ways, unparent the children
+       both in the destructor and in a signal handler. See the example code.</para>
+
 <section xml:id="custom-container-example">
 <title>Example</title>
 
-    <para>This example implements a container with two child widgets, one above
+    <para>This example implements a container with child widgets, one above
         the other. Of course, in this case it would be far simpler just to use
         a vertical <classname>Gtk::Box</classname> or <classname>Gtk::Grid</classname>.</para>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]