[Gtk-sharp-list] Adding a shortcut to menu or a button
ajselvig at gmail.com
Mon Aug 25 23:12:30 EDT 2008
I'm having the same issue. Perhaps someone could provide a bit more direction.
I tried using an AccelGroup, but the documentation is limited and I
can't figure out how to create the closure for AccelGroup.Connect(). I
also tried using AccelMap.AddEntry(), but it doesn't seem to do
It seems like there are many different ways to do this in GTK
(AccelGroup, AccelMap, ItemFactory) but none of them are very clear.
On Sun, Aug 24, 2008 at 1:48 AM, Michael Hutchinson
<m.j.hutchinson at gmail.com> wrote:
> On Sun, Aug 24, 2008 at 12:59 AM, True Friend <true.friend2004 at gmail.com> wrote:
>> I am seeking a way to add shortcut (say to call file save method) in a menu
>> item or a toolbar button or in a simple button. I cannot find a way to add a
>> shortcut. I tried to capture the key press event like this.
>> protected virtual void OnCombobox1KeyPressEvent (object o,
>> Gtk.KeyPressEventArgs args)
>> if(args.Event.State == Gdk.ModifierType.ControlMask)
>> if(args.Event.Key == Gdk.Key.s)
>> Gtk.FileChooserDialog fc=
>> new Gtk.FileChooserDialog("Choose the file to open",
>> but I cannot get it worked either. Any ideas how to do this?
> I don't have time for a full answer right now, but this is a good
> starting point:
> (For some reason GTK+ calls shortcuts "accelerators").
> Michael Hutchinson
> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
More information about the Gtk-sharp-list