summaryrefslogtreecommitdiff
path: root/gir/gobject-2.0.c
diff options
context:
space:
mode:
Diffstat (limited to 'gir/gobject-2.0.c')
-rw-r--r--gir/gobject-2.0.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gir/gobject-2.0.c b/gir/gobject-2.0.c
index 676c4060..efe8981a 100644
--- a/gir/gobject-2.0.c
+++ b/gir/gobject-2.0.c
@@ -131,6 +131,19 @@
* GObject ships with a utility called [glib-mkenums][glib-mkenums],
* that can construct suitable type registration functions from C enumeration
* definitions.
+ *
+ * Example of how to get a string representation of an enum value:
+ * |[<!-- language="C" -->
+ * GEnumClass *enum_class;
+ * GEnumValue *enum_value;
+ *
+ * enum_class = g_type_class_ref (MAMAN_TYPE_MY_ENUM);
+ * enum_value = g_enum_get_value (enum_class, MAMAN_MY_ENUM_FOO);
+ *
+ * g_print ("Name: %s\n", enum_value->value_name);
+ *
+ * g_type_class_unref (enum_class);
+ * ]|
*/