Re: keyboard short cuts/accelerators



On Sat, 2009-03-07 at 16:28 +1100, Grizzly(Francis Smit) wrote: 
> Grizzly(Francis Smit) wrote:
> > José Alburquerque wrote:
> >   
> 
> > Ummm could you tell me more set_accel_key(const AccelKey& accel_key)
> > looks the best but it's protected, should I derive and use this??
> >
> > set_accel_path(const Glib::ustring& accel_path)
> >
> >
> > is available  but I don't understand what it does
> >
> >   
> OK I did it by overloading Gtk::ImageMenuItem and exposing the
> functionality
> of 
> 
> set_accel_path(const Glib::ustring& accel_path) 

I think there's probably an easier way.

> but how do I get the little 
> label telling me what the accel is next to the item i.e. the Crtl+C Ctrl+D 
> or whatever.  I have tried add_accel_label(const Glib::ustring& label, bool mnemonic=true) 
> but it doesn't work :( 

I don't really have an answer but I remember that with buttons, an
underscore ('_') sets the mnemonic for the button and something similar
may be done with menus.  I would refer you to the chapter on menus[1] of
the online book.

[1]
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-menus-and-toolbars.html

It may be that the first answer I gave you applies because I know that
in the GNOME desktop there's a way to enable an option using the
configuration editor (gconf-editor) so that menu accelerators can be set
by placing the mouse pointer over the menu item and then pressing the
key combination.  The new key combination will be shown next to the menu
item this way.

-- 
José Alburquerque
jaalburquerque cox net



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