Imagine you have a GtkEntry on a form:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="GtkEntryWnd" parent="GtkApplicationWindow">
<property name="default-width">320</property>
<property name="default-height">320</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="homogeneous">1</property>
<child>
<object class="GtkLabel">
<property name="label">Friendly name</property>
</object>
</child>
<child>
<object class="GtkEntry" id="displayName">
<!-- <binding ??? -->
</object>
...
And in your GtkEntryWnd
struct _GtkEntryWnd
{
GtkApplicationWindow parent_instance;
gchar* displayName;
};
you’ve registered “DisplayName” property in the following way:
properties[PROP_DISPLAY_NAME] = g_param_spec_string("DisplayName", "DisplayName",
"Friendly name", NULL, (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
Can a text shown by GtkEntry be bound to the value of “DisplayName”?