problems with accelerators in menu



Hi there!

I've wrote a menubar with Gtk::Action, something like this:

	 refActionGroup->add(Gtk::Action::create("Foo",
                                             Gtk::Stock::YES,
	                                         "_Foo"),
	                     sigc::mem_fun(*this,
                                       &Window::on_foo));

	 refActionGroup->add(Gtk::Action::create("Bar",
                                              Gtk::Stock::NO,
	                                         "_Bar"),
                             sigc::mem_fun(*this,
                                           &Window::on_bar));

	/* uimanager settings */

	pFoo = refUIManager->get_widget("/Where/Is/Foo");
	pBar = refUIManager->get_widget("/Where/Is/Bar");
	
	// so:
	
	refAccel = (refUIManager->get_accel_group());
	add_accel_group(refAccel);

	pFoo->add_accelerator("activate", refAccel,
	                      'R', Gdk::CONTROL_MASK,
                           Gtk::ACCEL_VISIBLE);

	pBar->add_accelerator("activate", refAccel,
	                      'R',  Gdk::SHIFT_MASK | Gdk::CONTROL_MASK,
                          Gtk::ACCEL_VISIBLE);
	
But I've two problems:

1) pBar accelerator does not work.
2) The menu does not show "Ctr+R' and 'Shift+Ctrl+R' labels

What's wrong with that?

Thanks in advance,

s.








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