From f519e156e88b1fa7cd0bdba207ba604a76f9ae5f Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Tue, 3 Aug 2010 15:40:44 +0200 Subject: [PATCH] allow multiple selections --- tests/examples/ges-ui.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/examples/ges-ui.c b/tests/examples/ges-ui.c index 82f51f4adb..3c5995f386 100644 --- a/tests/examples/ges-ui.c +++ b/tests/examples/ges-ui.c @@ -466,9 +466,13 @@ app_update_selection (App * app) type = G_TYPE_NONE; if (app->selected_objects) { - /* TODO: when we allow multiple selections, only set this if all values - * are the same */ type = G_TYPE_FROM_INSTANCE (app->selected_objects->data); + for (cur = app->selected_objects; cur; cur = cur->next) { + if (type != G_TYPE_FROM_INSTANCE (cur->data)) { + type = G_TYPE_NONE; + break; + } + } } app->selected_type = type; } @@ -1003,6 +1007,8 @@ create_ui (App * app) if (!(app->selection = gtk_tree_view_get_selection (timeline))) goto fail; + gtk_tree_selection_set_mode (app->selection, GTK_SELECTION_MULTIPLE); + g_signal_connect (app->selection, "changed", G_CALLBACK (app_selection_changed_cb), app);