From 9107efb4ac0b45c11aa18cec7f09be67a374afa2 Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Thu, 22 Jul 2010 10:18:41 +0200 Subject: [PATCH] also set state of delete menu item --- tests/examples/ges-ui.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/examples/ges-ui.c b/tests/examples/ges-ui.c index 2e9cf5c862..e4bc56f8ec 100644 --- a/tests/examples/ges-ui.c +++ b/tests/examples/ges-ui.c @@ -35,6 +35,7 @@ typedef struct App int n_selected; GtkHScale *duration; GtkHScale *in_point; + GtkMenuItem *delete_item; } App; App *app_new (void); @@ -112,8 +113,11 @@ app_selection_changed_cb (GtkTreeSelection * selection, App * app) { app_update_selection (app); - /* some widgets should be disabled when we have an empty selection */ - gtk_widget_set_sensitive (app->properties, app->n_selected > 0); + /* doesn't make sense to set properties on more than one item */ + gtk_widget_set_sensitive (app->properties, app->n_selected == 1); + + /* delete will work for multiple items */ + gtk_widget_set_sensitive (GTK_WIDGET (app->delete_item), app->n_selected > 0); } gboolean @@ -463,6 +467,7 @@ create_ui (App * app) GET_WIDGET (app->in_point, "in_point_scale", GTK_HSCALE); GET_WIDGET (duration_col, "duration_column", GTK_TREE_VIEW_COLUMN); GET_WIDGET (duration_renderer, "duration_renderer", GTK_CELL_RENDERER); + GET_WIDGET (app->delete_item, "delete_item", GTK_MENU_ITEM); /* we care when the tree selection changes */