+2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
+
+ * tests/prop-editor.c (properties_from_type): Use
+ g_object_class_list_properties to get the param specs
+ for a given type. (#58609)
+
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* gtk/gtkstyle.c (gtk_style_real_unrealize): Don't forget to
+2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
+
+ * tests/prop-editor.c (properties_from_type): Use
+ g_object_class_list_properties to get the param specs
+ for a given type. (#58609)
+
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* gtk/gtkstyle.c (gtk_style_real_unrealize): Don't forget to
+2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
+
+ * tests/prop-editor.c (properties_from_type): Use
+ g_object_class_list_properties to get the param specs
+ for a given type. (#58609)
+
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* gtk/gtkstyle.c (gtk_style_real_unrealize): Don't forget to
+2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
+
+ * tests/prop-editor.c (properties_from_type): Use
+ g_object_class_list_properties to get the param specs
+ for a given type. (#58609)
+
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* gtk/gtkstyle.c (gtk_style_real_unrealize): Don't forget to
+2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
+
+ * tests/prop-editor.c (properties_from_type): Use
+ g_object_class_list_properties to get the param specs
+ for a given type. (#58609)
+
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* gtk/gtkstyle.c (gtk_style_real_unrealize): Don't forget to
+2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
+
+ * tests/prop-editor.c (properties_from_type): Use
+ g_object_class_list_properties to get the param specs
+ for a given type. (#58609)
+
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* gtk/gtkstyle.c (gtk_style_real_unrealize): Don't forget to
+2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
+
+ * tests/prop-editor.c (properties_from_type): Use
+ g_object_class_list_properties to get the param specs
+ for a given type. (#58609)
+
2001-08-09 Matthias Clasen <matthiasc@waldgeist.poet.de>
* gtk/gtkstyle.c (gtk_style_real_unrealize): Don't forget to
#include "prop-editor.h"
-static void
-get_param_specs (GType type,
- GParamSpec ***specs,
- gint *n_specs)
-{
- GObjectClass *class = g_type_class_peek (type);
-
- /* We count on the fact we have an instance, or else we'd have
- * to use g_type_class_ref ();
- */
-
- /* Use private interface for now, fix later */
- *specs = NULL; /* class->property_specs; */
- *n_specs = 0; /* class->n_property_specs; */
-}
typedef struct
{
name = g_type_name (G_TYPE_FROM_INSTANCE (obj));
else
name = "unknown";
- str = g_strdup_printf ("Objetct: %p (%s)", obj, name);
+ str = g_strdup_printf ("Object: %p (%s)", obj, name);
gtk_label_set_text (label, str);
g_free (str);
GtkWidget *sw;
GtkWidget *vbox;
GtkWidget *table;
+ GObjectClass *class;
+ GParamSpec **specs;
+ gint n_specs;
int i;
- gint n_specs = 0;
- GParamSpec **specs = NULL;
-
- get_param_specs (type, &specs, &n_specs);
+ class = G_OBJECT_CLASS (g_type_class_peek (type));
+ specs = g_object_class_list_properties (class, &n_specs);
+
if (n_specs == 0)
return NULL;
continue;
}
+ if (spec->owner_type != type)
+ {
+ /* we're only interested in params of type */
+ ++i;
+ continue;
+ }
+
label = gtk_label_new (spec->nick);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, i, i + 1);
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), vbox);
+
+ g_free (specs);
+
return sw;
}
gtk_container_add (GTK_CONTAINER (win), notebook);
type = G_TYPE_FROM_INSTANCE (object);
-
+
title = g_strdup_printf ("Properties of %s widget", g_type_name (type));
gtk_window_set_title (GTK_WINDOW (win), title);
g_free (title);