docs: Use G_PARAM_STATIC_STRINGS in examples and explain it more

Make it a bit clearer in the documentation that using
`G_PARAM_STATIC_STRINGS` everywhere is a good thing.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall
2022-05-20 12:55:18 +01:00
parent 6b5b1cd314
commit 8f9c5090db
5 changed files with 13 additions and 7 deletions

View File

@@ -722,12 +722,12 @@ g_object_class_install_property (GObjectClass *class,
* g_param_spec_int ("foo", "Foo", "Foo",
* -1, G_MAXINT,
* 0,
* G_PARAM_READWRITE);
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
*
* obj_properties[PROP_BAR] =
* g_param_spec_string ("bar", "Bar", "Bar",
* NULL,
* G_PARAM_READWRITE);
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
*
* gobject_class->set_property = my_object_set_property;
* gobject_class->get_property = my_object_get_property;
@@ -1421,7 +1421,7 @@ g_object_notify (GObject *object,
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
* 0, 100,
* 50,
* G_PARAM_READWRITE);
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);