diff finch/gntstatus.c @ 18511:7ee0e0597a26

Add utility function to trigger some button when some key is pressed with some other widget in focus. So now, pressing Insert in the accounts, status, pounce dialog will activate the 'Add' button, pressing Delete will activate the 'Delete' button. This can probably be used in some other places.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 13 Jul 2007 01:42:29 +0000
parents 9a0f99ea664d
children d65ce3df5be2 ae6b1f1c6686
line wrap: on
line diff
--- a/finch/gntstatus.c	Fri Jul 13 01:30:08 2007 +0000
+++ b/finch/gntstatus.c	Fri Jul 13 01:42:29 2007 +0000
@@ -30,6 +30,7 @@
 #include <gntlabel.h>
 #include <gntline.h>
 #include <gnttree.h>
+#include <gntutils.h>
 
 #include "finch.h"
 
@@ -196,6 +197,7 @@
 
 	button = gnt_button_new(_("Add"));
 	gnt_box_add_widget(GNT_BOX(box), button);
+	gnt_util_set_trigger_widget(tree, GNT_KEY_INS, button);
 	g_signal_connect_swapped(G_OBJECT(button), "activate",
 			G_CALLBACK(finch_savedstatus_edit), NULL);
 
@@ -206,6 +208,7 @@
 
 	button = gnt_button_new(_("Delete"));
 	gnt_box_add_widget(GNT_BOX(box), button);
+	gnt_util_set_trigger_widget(tree, GNT_KEY_DEL, button);
 	g_signal_connect(G_OBJECT(button), "activate",
 			G_CALLBACK(ask_before_delete), NULL);