diff finch/gntpounce.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 2d4df5ef0090
children d65ce3df5be2 b8870878531e
line wrap: on
line diff
--- a/finch/gntpounce.c	Fri Jul 13 01:30:08 2007 +0000
+++ b/finch/gntpounce.c	Fri Jul 13 01:42:29 2007 +0000
@@ -32,6 +32,8 @@
 #include <gntlabel.h>
 #include <gntline.h>
 #include <gnttree.h>
+#include <gntutils.h>
+
 #include "internal.h"
 #include "finch.h"
 
@@ -699,6 +701,7 @@
 	/* Add button */
 	button = gnt_button_new(_("Add"));
 	gnt_box_add_widget(GNT_BOX(bbox), button);
+	gnt_util_set_trigger_widget(tree, GNT_KEY_INS, button);
 
 	g_signal_connect(G_OBJECT(button), "activate",
 					 G_CALLBACK(pounces_manager_add_cb), dialog);
@@ -715,6 +718,7 @@
 	button = gnt_button_new(_("Delete"));
 	dialog->delete_button = button;
 	gnt_box_add_widget(GNT_BOX(bbox), button);
+	gnt_util_set_trigger_widget(tree, GNT_KEY_DEL, button);
 
 	g_signal_connect(G_OBJECT(button), "activate",
 					 G_CALLBACK(pounces_manager_delete_cb), dialog);