index b62287affd29445bfeb3319e98ba586b5aabbb5a..f6369f39ad306a87acf892d0712786da6223b84f 100644 (file)
#include "sp-anchor.h"
#include "sp-attribute-widget.h"
+#include <sigc++/connection.h>
+#include <sigc++/functors/ptr_fun.h>
+#include <sigc++/adaptors/bind.h>
+
struct SPAttrDesc {
gchar const *label;
gchar const *attribute;
static void
-object_released (GtkObject *object, GtkWidget *widget)
+object_released (SPObject *object, GtkWidget *widget)
{
gtk_widget_destroy (widget);
}
static void
window_destroyed (GtkObject *window, GtkObject *object)
{
- sp_signal_disconnect_by_data (object, window);
+ sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(window), "release_connection");
+ release_connection->disconnect();
+ delete release_connection;
}
attrs[i] = desc[i].attribute;
}
- title = g_strdup_printf (_("%s attributes"), tag);
+ title = g_strdup_printf (_("%s Properties"), tag);
w = sp_window_new (title, TRUE);
g_free (title);
g_signal_connect ( G_OBJECT (w), "destroy",
G_CALLBACK (window_destroyed), object );
- g_signal_connect ( G_OBJECT (object), "release",
- G_CALLBACK (object_released), w );
+ sigc::connection *release_connection = new sigc::connection();
+ *release_connection = object->connectRelease(sigc::bind<1>(sigc::ptr_fun(&object_released), w));
+ g_object_set_data(G_OBJECT(w), "release_connection", release_connection);
gtk_widget_show (w);