summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-04-07 04:15:33 +0000
committerMatthias Clasen <mclasen@redhat.com>2020-04-07 04:15:33 +0000
commitba05787a06c95d42e69f7d19ed0e6d30367ff68f (patch)
treee4b500b0ffd61372182e5f2c4eb889d3bdf3783f
parent1ae60cb713f2bd027c65b28a977d82e8c87b1bb8 (diff)
parent12b97ffd24e35ea45f6d4a5c78b1b0e10965c4ac (diff)
downloadgtk+-ba05787a06c95d42e69f7d19ed0e6d30367ff68f.tar.gz
Merge branch 'attribute-docs' into 'master'
entry: Document buildable support See merge request GNOME/gtk!1643
-rw-r--r--gtk/gtkentry.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index e823ab0d08..5e95bd6fc3 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -138,6 +138,30 @@
*
* For all the subnodes added to the text node in various situations,
* see #GtkText.
+ *
+ * # GtkEntry as GtkBuildable
+ *
+ * The GtkEntry implementation of the GtkBuildable interface supports a
+ * custom <attributes> element, which supports any number of <attribute>
+ * elements. The <attribute> element has attributes named “name“, “value“,
+ * “start“ and “end“ and allows you to specify #PangoAttribute values for
+ * this label.
+ *
+ * An example of a UI definition fragment specifying Pango attributes:
+ * |[
+ * <object class="GtkEnry">
+ * <attributes>
+ * <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+ * <attribute name="background" value="red" start="5" end="10"/>
+ * </attributes>
+ * </object>
+ * ]|
+ *
+ * The start and end attributes specify the range of characters to which the
+ * Pango attribute applies. If start and end are not specified, the attribute is
+ * applied to the whole text. Note that specifying ranges does not make much
+ * sense with translatable attributes. Use markup embedded in the translatable
+ * content instead.
*/
#define MAX_ICONS 2