summaryrefslogtreecommitdiff
path: root/pygtype.c
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2002-01-24 07:24:03 +0000
committerJames Henstridge <jamesh@src.gnome.org>2002-01-24 07:24:03 +0000
commit91e3acf5a52a5d39e06199d39d0ebd37f081dafe (patch)
tree6ac6399418bf5980bdc07f82c6040712db0841d8 /pygtype.c
parentbca1682f341ecc3418d7ddcbd2ef0d51c0913759 (diff)
downloadpygtk-91e3acf5a52a5d39e06199d39d0ebd37f081dafe.tar.gz
use g_string_append_printf(). (add_property_docs): same here.
2002-01-24 James Henstridge <james@daa.com.au> * pygtype.c (add_signal_docs): use g_string_append_printf(). (add_property_docs): same here. * examples/simple/tooltip.py: updated version from Steve George.
Diffstat (limited to 'pygtype.c')
-rw-r--r--pygtype.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/pygtype.c b/pygtype.c
index 66b1df7c..df8530f4 100644
--- a/pygtype.c
+++ b/pygtype.c
@@ -781,9 +781,8 @@ add_signal_docs(GType gtype, GString *string)
signal_ids = g_signal_list_ids(gtype, &n_ids);
if (n_ids > 0) {
- g_string_append(string, "Signals from ");
- g_string_append(string, g_type_name(gtype));
- g_string_append(string, ":\n");
+ g_string_append_printf(string, "Signals from %s:\n",
+ g_type_name(gtype));
for (i = 0; i < n_ids; i++) {
GSignalQuery query;
@@ -824,20 +823,16 @@ add_property_docs(GType gtype, GString *string)
props = g_object_class_list_properties(class, &n_props);
if (n_props > 0) {
- g_string_append(string, "Properties from ");
- g_string_append(string, g_type_name(gtype));
- g_string_append(string, ":\n");
+ g_string_append_printf(string, "Properties from %s:\n",
+ g_type_name(gtype));
for (i = 0; i < n_props; i++) {
- g_string_append(string, " ");
- g_string_append(string, g_param_spec_get_name(props[i]));
- g_string_append(string, " -> ");
- g_string_append(string, g_type_name(props[i]->value_type));
- g_string_append(string, ": ");
- g_string_append(string, g_param_spec_get_nick(props[i]));
- g_string_append(string, "\n ");
- g_string_append(string, g_param_spec_get_blurb(props[i]));
- g_string_append(string, "\n");
+ g_string_append_printf(string, " %s -> %s: %s\n",
+ g_param_spec_get_name(props[i]),
+ g_type_name(props[i]->value_type),
+ g_param_spec_get_nick(props[i]));
+ g_string_append_printf(string, " %s\n",
+ g_param_spec_get_blurb(props[i]));
}
g_free(props);
g_string_append(string, "\n");
@@ -865,11 +860,11 @@ object_doc_descr_get(PyObject *self, PyObject *obj, PyObject *type)
string = g_string_new_len(NULL, 512);
if (g_type_is_a(gtype, G_TYPE_INTERFACE))
- g_string_append(string, "Interface ");
+ g_string_append_printf(string, "Interface %s\n\n", g_type_name(gtype));
else if (g_type_is_a(gtype, G_TYPE_OBJECT))
- g_string_append(string, "Object ");
- g_string_append(string, g_type_name(gtype));
- g_string_append(string, "\n\n");
+ g_string_append_printf(string, "Object %s\n\n", g_type_name(gtype));
+ else
+ g_string_append_printf(string, "%s\n\n", g_type_name(gtype));
if (g_type_is_a(gtype, G_TYPE_OBJECT)) {
GType parent = G_TYPE_OBJECT;