Re: [gtkmm] Problems with Gtk::MenuItem accelerators



On Tue, Sep 09, 2003 at 12:23:30AM +0200, Simon Fuhrmann wrote:
> Hi!
> 
> I want to create a menu with accelerators for menu items (e.g. <control>q
> for "File->Quit"). My understanding of the accelerator path and the
> accelerator map is that I can define a path in the global map with:

You are making this more complicated than necessary. Use menu helpers instead.
Read the tutorial: http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch10.html

Gtk::Menu_Helpers::MenuElem has constructors that take AccelKey arguments
and handles the AccelMap stuff for you. You can do simply:
my_menu_list.push_back("_Foo", AccelKey("<control>F"), slot(whatever));

/Fredrik Arnerup



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