Re: Accelerator



Stefan Kost wrote:
dhk schrieb:
Are accelerators only for menu items?  I've seen a lot of examples with
accelerators and the all seem to connect to a menu item.  I've been
having a difficult time getting accelerators to work even with the
examples.  I think I'm missing something.

One thing I would like is to just have an accelerator execute a function
or a callback.  Maybe if I could just print "Hello World" to the
terminal when pressing Alt-F4 would help prove the concept.

I am struggling with the same issue and resorted to a terrible hack. I've
defined a popupmenu which I never show. It contains menu items with the
accelerators. Voila, global accelerators for the app :)

Stefan

Can someone help?

Thanks,

dhk
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



The following is from the Glade mailing list yesterday, the same day as your email. It sounds like there could be a bug, but I'm not sure. I am still having a difficulty getting an accelerator to work: don'tknow what's wrong.

On Sat, Jun 6, 2009 at 4:52 PM, Jonathan Lane<lanej horizon com> wrote:
> > I've asked this on the list before, but it's hard to imagine that no
> > one else has noticed this, so I must be doing something wrong.
> >
> > I'm trying to add accelerators (such as CTRL-O, etc) to my MenuItems.
> > On the Common tab for the GtkImageMenuItem, I hook the accelerator I
> > want to the activate signal.
> >
> > Is this not the way I should be doing it?  Some of them work, but most
> > don't, and I can't figure why.
> >
> > I'm using glade 3.6.3 and saving my projects in Builder format.

Gah, This is my mistake.

This needs to be fixed in GTK+, GtkMenuItem doesnt use an accel-group
property to connect to the window's accel-group, right now the "accel-group"
is only handled by GtkImageMenuItem but it should be handled by
menu items in general.

Im sure there is a bug open for this but I cant seem to find it
right now.

Sorry for this inconvenience.

Cheers,
           -Tristan
_______________________________________________
Glade-users maillist  -  Glade-users lists ximian com
http://lists.ximian.com/mailman/listinfo/glade-users




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