Runtime menu point generation



Hello, colleagues !

I have to add menu point into main menu application. I do 
pActionGroup = Gtk::ActionGroup::create();
Glib::RefPtr <Gtk::Action> fileOpenAct = Gtk::Action::create ("FileOpen",
Gtk::Stock::OPEN, _("Open"), _("Open file from current path"));
Gtk::AccelKey fileOpenKey ('O', Gdk::CONTROL_MASK);
pActionGroup->add ( fileOpenAct, fileOpenKey,
sigc::mem_fun (*this, &MainWindow::fileOpen));

Gtk::MenuItem* openItem = fileOpenAct->create_menu_item ();
openItem->set_name ("FileOpen");
Gtk::Menu* fileMenu = pMenuBar->items ().begin ()->get_submenu();
fileMenu->insert (*openItem, 2); 

Menu point is created, but there is an error 
Gtk-CRITICAL **: gtk_accel_label_set_accel_closure: assertion
`gtk_accel_group_from_accel_closure (accel_closure) != NULL' failed 

on code

Gtk::MenuItem* openItem = fileOpenAct->create_menu_item ();

and acceleration key does not assign. Any idea ?

Best regards,
Yuriy Rusinov.

-- 
View this message in context: http://www.nabble.com/Runtime-menu-point-generation-tp19738236p19738236.html
Sent from the Gtkmm mailing list archive at Nabble.com.



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