Re: Gtk::Notebook with different accelerators on each page



On Tue, Feb 09, 2010 at 03:43:37PM +0100, Martin Buck wrote:
> This nearly works, however, only for accelerator keys defined on
> the first notebook page. If the same accelerator key is used on the 2nd
> page, it works there and calls the right function, but accelerators keys
> defined only on the 2nd page don't work at all.

OK, problem solved. This was caused by a bug in the old GTK+ 2.8.20 I was
using. It did not refresh the key hash in GtkWindow when calling
gtk_window_add_accel_group(). Seems to be fixed in newer GTK+'s and can be
worked around in the old version by calling
Gtk::Window::set_mnemonic_modifier() which has the side effect of
refreshing the key hash.


BTW, is there a particular reason why Gtk::MenuShell::accelerate() insists
on receiving a Gtk::Widget or Gtk::Window? All it needs from those is the
Gtk::AccelGroup and while it is convenient that it can find that by itself,
in my case it would be much more convenient to be able to simply pass it my
own Gtk::AccelGroup. May I suggest to add a
Gtk::MenuShell::accelerate(Glib::RefPtr<AccelGroup> &) function and use
that internally in the other 2 accelerate()s above?

Anyone interested in a patch?

Thanks,
Martin


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