summaryrefslogtreecommitdiffstats
path: root/src/dialogs/object-attributes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/object-attributes.cpp')
-rw-r--r--src/dialogs/object-attributes.cpp40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/dialogs/object-attributes.cpp b/src/dialogs/object-attributes.cpp
index f83d3ef1f..bdb292622 100644
--- a/src/dialogs/object-attributes.cpp
+++ b/src/dialogs/object-attributes.cpp
@@ -72,7 +72,6 @@ static void object_released( SPObject */*object*/, GtkWidget *widget )
}
-
static void window_destroyed( GtkObject *window, GtkObject */*object*/ )
{
sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(window), "release_connection");
@@ -81,26 +80,16 @@ static void window_destroyed( GtkObject *window, GtkObject */*object*/ )
}
-
static void sp_object_attr_show_dialog ( SPObject *object,
const SPAttrDesc *desc,
const gchar *tag )
{
- const gchar **labels, **attrs;
- gint len, i;
+ int len;
+ GtkWidget *w;
+ SPAttributeTable* t;
Glib::ustring title;
- GtkWidget *w, *t;
-
- len = 0;
- while (desc[len].label) len += 1;
-
- labels = (const gchar **) new gchar* [len];
- attrs = (const gchar **) new gchar* [len];
-
- for (i = 0; i < len; i++) {
- labels[i] = desc[i].label;
- attrs[i] = desc[i].attribute;
- }
+ std::vector<Glib::ustring> labels;
+ std::vector<Glib::ustring> attrs;
if (!strcmp (tag, "Link")) {
title = _("Link Properties");
@@ -110,17 +99,21 @@ static void sp_object_attr_show_dialog ( SPObject *object,
title = Glib::ustring::compose(_("%1 Properties"), tag);
}
+ len = 0;
+ while (desc[len].label)
+ {
+ labels.push_back(desc[len].label);
+ attrs.push_back (desc[len].attribute);
+ len += 1;
+ }
+
w = sp_window_new (title.c_str(), TRUE);
-
- t = sp_attribute_table_new (object, len, labels, attrs);
- gtk_widget_show (t);
- gtk_container_add (GTK_CONTAINER (w), t);
- delete labels;
- delete attrs;
+ t = new SPAttributeTable (object, labels, attrs, GTK_CONTAINER (w));
+ t->show();
+ //gtk_container_add (GTK_CONTAINER (w), (GtkWidget*)t->gobj());
g_signal_connect ( G_OBJECT (w), "destroy",
G_CALLBACK (window_destroyed), object );
-
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);
@@ -129,7 +122,6 @@ static void sp_object_attr_show_dialog ( SPObject *object,
} // end of sp_object_attr_show_dialog()
-
void sp_object_attributes_dialog (SPObject *object, const gchar *tag)
{
g_return_if_fail (object != NULL);