Gtk+3 How to specify child properties of stack
I am new to gtk and I am trying to build a gtk application.
I went through the gtk tutorial to create gtk application.
I want to specify "gtk stack child property title" in xml which is loaded via gktbuilder.
How can I specify "gtk stack child property title" in xml and where can I get manual for the xml I cannot find it anywhere?
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.8 -->
<object class="GtkWindow" id="window">
<property name="title" translatable="yes">GLocalshare</property>
<property name="default-width">600</property>
<property name="default-height">400</property>
<child>
<object class="GtkBox" id="content_box">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkHeaderBar" id="header">
<property name="visible">True</property>
<property name="show-close-button">True</property>
<child type="title">
<object class="GtkStackSwitcher" id="tabs">
<property name="visible">True</property>
<property name="margin">6</property>
<property name="stack">stack</property>
<child>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="visible-child">label1</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label">label1</property>
<property name="title">label1</property>
<property name="name">label1</property>
</object>
</child>
<child >
<object class="GtkLabel" id="label2">
<property name="title">label2</property>
<property name="visible">True</property>
<property name="label">label2</property>
<property name="name">label2</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>
You can find the documentation on this here, in the sections Child properties
and GtkContainer as GtkBuildable
:
The GtkContainer implementation of the GtkBuildable interface supports a
<packing>
element for children, which can contain multiple<property>
elements that specify child properties for the child. An example of child properties in UI definitions:
<object class="GtkVBox">
<child>
<object class="GtkLabel"/>
<packing>
<property name="pack-type">start</property>
</packing>
</child>
</object>