}
static void
-connect_controller (GObject *controller,
- const gchar *signal,
- GObject *model,
- GParamSpec *spec,
- GtkSignalFunc func)
+connect_controller (GObject *controller,
+ const gchar *signal,
+ GObject *model,
+ GParamSpec *spec,
+ GCallback func)
{
ObjectProperty *p;
if (can_modify)
connect_controller (G_OBJECT (adj), "value_changed",
- object, spec, (GtkSignalFunc) int_modified);
+ object, spec, G_CALLBACK (int_modified));
}
else if (type == G_TYPE_PARAM_UINT)
{
if (can_modify)
connect_controller (G_OBJECT (adj), "value_changed",
- object, spec, (GtkSignalFunc) uint_modified);
+ object, spec, G_CALLBACK (uint_modified));
}
else if (type == G_TYPE_PARAM_FLOAT)
{
if (can_modify)
connect_controller (G_OBJECT (adj), "value_changed",
- object, spec, (GtkSignalFunc) float_modified);
+ object, spec, G_CALLBACK (float_modified));
}
else if (type == G_TYPE_PARAM_DOUBLE)
{
if (can_modify)
connect_controller (G_OBJECT (adj), "value_changed",
- object, spec, (GtkSignalFunc) double_modified);
+ object, spec, G_CALLBACK (double_modified));
}
else if (type == G_TYPE_PARAM_STRING)
{
if (can_modify)
connect_controller (G_OBJECT (prop_edit), "changed",
- object, spec, (GtkSignalFunc) string_modified);
+ object, spec, G_CALLBACK (string_modified));
}
else if (type == G_TYPE_PARAM_BOOLEAN)
{
if (can_modify)
connect_controller (G_OBJECT (prop_edit), "toggled",
- object, spec, (GtkSignalFunc) bool_modified);
+ object, spec, G_CALLBACK (bool_modified));
}
else if (type == G_TYPE_PARAM_ENUM)
{
if (can_modify)
connect_controller (G_OBJECT (prop_edit), "changed",
- object, spec, (GtkSignalFunc) enum_modified);
+ object, spec, G_CALLBACK (enum_modified));
}
}
else if (type == G_TYPE_PARAM_FLAGS)
gtk_box_pack_start (GTK_BOX (prop_edit), b, FALSE, FALSE, 0);
if (can_modify)
connect_controller (G_OBJECT (b), "toggled",
- object, spec, (GtkSignalFunc) flags_modified);
+ object, spec, G_CALLBACK (flags_modified));
}
g_type_class_unref (fclass);
if (can_modify)
connect_controller (G_OBJECT (prop_edit), "changed",
- object, spec, (GtkSignalFunc) unichar_modified);
+ object, spec, G_CALLBACK (unichar_modified));
}
else if (type == G_TYPE_PARAM_POINTER)
{
}
static GtkWidget *
-properties_from_type (GObject *object,
- GType type,
- GtkTooltips *tips)
+properties_from_type (GObject *object,
+ GType type)
{
GtkWidget *prop_edit;
GtkWidget *label;
gtk_widget_set_sensitive (prop_edit, FALSE);
if (g_param_spec_get_blurb (spec))
- gtk_tooltips_set_tip (tips, prop_edit, g_param_spec_get_blurb (spec), NULL);
-
+ gtk_widget_set_tooltip_text (prop_edit, g_param_spec_get_blurb (spec));
+
/* set initial value */
g_object_notify (object, spec->name);
}
}
static GtkWidget *
-child_properties_from_object (GObject *object,
- GtkTooltips *tips)
+child_properties_from_object (GObject *object)
{
GtkWidget *prop_edit;
GtkWidget *label;
gtk_widget_set_sensitive (prop_edit, FALSE);
if (g_param_spec_get_blurb (spec))
- gtk_tooltips_set_tip (tips, prop_edit, g_param_spec_get_blurb (spec), NULL);
-
+ gtk_widget_set_tooltip_text (prop_edit, g_param_spec_get_blurb (spec));
+
/* set initial value */
gtk_widget_child_notify (GTK_WIDGET (object), spec->name);
}
}
static GtkWidget *
-children_from_object (GObject *object,
- GtkTooltips *tips)
+children_from_object (GObject *object)
{
GList *children, *c;
GtkWidget *table, *label, *prop_edit, *button, *vbox, *sw;
}
static GtkWidget *
-cells_from_object (GObject *object,
- GtkTooltips *tips)
+cells_from_object (GObject *object)
{
GList *cells, *c;
GtkWidget *table, *label, *prop_edit, *button, *vbox, *sw;
return sw;
}
-static void
-kill_tips (GtkWindow *win, GtkObject *tips)
-{
- gtk_object_destroy (tips);
- g_object_unref (tips);
-}
/* Pass zero for type if you want all properties */
GtkWidget*
{
GtkWidget *win;
GtkWidget *notebook;
- GtkTooltips *tips;
GtkWidget *properties;
GtkWidget *label;
gchar *title;
gtk_window_set_screen (GTK_WINDOW (win),
gtk_widget_get_screen (GTK_WIDGET (object)));
- tips = gtk_tooltips_new ();
- g_object_ref (tips);
- gtk_object_sink (GTK_OBJECT (tips));
-
- /* Kill the tips when the widget goes away. */
- g_signal_connect (win, "destroy", G_CALLBACK (kill_tips), tips);
-
/* hold a weak ref to the object we're editing */
g_object_set_data_full (G_OBJECT (object), "prop-editor-win", win, model_destroy);
g_object_set_data_full (G_OBJECT (win), "model-object", object, window_destroy);
while (type)
{
- properties = properties_from_type (object, type, tips);
+ properties = properties_from_type (object, type);
if (properties)
{
label = gtk_label_new (g_type_name (type));
ifaces = g_type_interfaces (G_TYPE_FROM_INSTANCE (object), &n_ifaces);
while (n_ifaces--)
{
- properties = properties_from_type (object, ifaces[n_ifaces], tips);
+ properties = properties_from_type (object, ifaces[n_ifaces]);
if (properties)
{
label = gtk_label_new (g_type_name (ifaces[n_ifaces]));
g_free (ifaces);
- properties = child_properties_from_object (object, tips);
+ properties = child_properties_from_object (object);
if (properties)
{
label = gtk_label_new ("Child properties");
properties, label);
}
- properties = children_from_object (object, tips);
+ properties = children_from_object (object);
if (properties)
{
label = gtk_label_new ("Children");
properties, label);
}
- properties = cells_from_object (object, tips);
+ properties = cells_from_object (object);
if (properties)
{
label = gtk_label_new ("Cell renderers");
}
else
{
- properties = properties_from_type (object, type, tips);
+ properties = properties_from_type (object, type);
gtk_container_add (GTK_CONTAINER (win), properties);
title = g_strdup_printf ("Properties of %s", g_type_name (type));
gtk_window_set_title (GTK_WINDOW (win), title);