Accelerators




I have noticed that many GTK/GNOME-programs are lacking the important
complement to mouse-only operation: acceleratorkeys.

To make the situation a little better, I've decided to make my programs
usable even without a mouse.

Question 1:
===========

Imagine a typical Yes-No dialog. Pressing enter will have the same effect
as clicking on yes. Pressing escape will equal no.

This works:

gtk_widget_add_accelerator (ok_button, "clicked",
			    accel_group, GDK_ISO_Enter, 0, 0);


I want to close the dialog by pressing escape...
But this code causes a GTK-warning to be printed:

gtk_widget_add_accelerator (dialog, "delete-event",
			    accel_group, GDK_Escape, 0, 0);

Why can't I do that?


Question 2:
===========

I have a table with label-entry -pairs. The labels have underlined letters
that indicates the shortcut to move focus to the corresponding entry.

Should these accelerator require a modifier (ie GDK_MOD1_MASK) like
menus do? 


Thanks

	-Jens




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]