From 2422ba7b22febffb9aa103ef14abdad79a370152 Mon Sep 17 00:00:00 2001 From: pmf Date: Wed, 20 Jun 2007 20:27:06 +0000 Subject: [PATCH] add cancel button to filter gui window git-svn-id: http://ltt.polymtl.ca/svn@2543 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/lttv/modules/gui/filter/filter.c | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/ltt/branches/poly/lttv/modules/gui/filter/filter.c b/ltt/branches/poly/lttv/modules/gui/filter/filter.c index 3b048900..ad22efca 100644 --- a/ltt/branches/poly/lttv/modules/gui/filter/filter.c +++ b/ltt/branches/poly/lttv/modules/gui/filter/filter.c @@ -79,6 +79,7 @@ gboolean callback_enter_check(GtkWidget *widget, void callback_add_button(GtkWidget *widget, gpointer data); void callback_logical_op_box(GtkWidget *widget, gpointer data); void callback_expression_field(GtkWidget *widget, gpointer data); +void callback_cancel_button(GtkWidget *widget, gpointer data); /** * @struct _FilterViewerDataLine @@ -125,6 +126,7 @@ struct _FilterViewerData { GPtrArray *f_math_op_options; /**< array of operators types for math_op box */ GtkWidget *f_add_button; /**< add expression to current expression (GtkButton) */ + GtkWidget *f_cancel_button; /**< cancel and close dialog (GtkButton) */ }; @@ -268,7 +270,14 @@ gui_filter(LttvPlugin *plugin) g_signal_connect (G_OBJECT (fvd->f_add_button), "clicked", G_CALLBACK (callback_add_button), (gpointer) fvd); - gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_add_button,6,7,1,2,GTK_FILL,GTK_FILL,0,0); + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_add_button,6,7,2,3,GTK_FILL,GTK_FILL,0,0); + + fvd->f_cancel_button = gtk_button_new_with_label("Cancel"); + gtk_widget_show (fvd->f_cancel_button); + g_signal_connect (G_OBJECT (fvd->f_cancel_button), "clicked", + G_CALLBACK (callback_cancel_button), (gpointer) fvd); + + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_cancel_button,6,7,1,2,GTK_FILL,GTK_FILL,0,0); fvd->f_logical_op_junction_box = gtk_combo_box_new_text(); for(i=0;if_logical_op_options->len;i++) { @@ -538,6 +547,20 @@ callback_process_button(GtkWidget *widget, gpointer data) { lttv_plugin_update_filter(fvd->plugin, filter); } +/** + * @fn void callback_cancel_button(GtkWidget*,gpointer) + * + * The Cancel Button callback function + * @param widget The Button widget passed to the callback function + * @param data Data sent along with the callback function + */ +void +callback_cancel_button(GtkWidget *widget, gpointer data) { + + FilterViewerData *fvd = (FilterViewerData*)data; + gtk_widget_destroy(fvd->f_window); +} + gboolean callback_enter_check(GtkWidget *widget, GdkEventKey *event, gpointer user_data) -- 2.34.1