JCLL
JCLL

Reputation: 5555

Ruby gtk3 Gtk::Accelerator missing. How to bypass?

I am trying to use Ruby gtk3 gem.

I read through Jan Bodnar zetcode, but I hit the following problem concerning image menu items : despite using correct 'gtk3' gem used by the author, my system (linux, with ruby 2.4.0 used with rvm) returns that :

gems/glib2-3.1.8/lib/glib2/deprecatable.rb:112:in `const_missing': uninitialized constant Gtk::Accelerator (NameError)

Here is the part of the code that causes the trouble :

newi = Gtk::ImageMenuItem.new :stock_id => Gtk::Stock::NEW,:accel_group => agr
key, mod = Gtk::Accelerator.parse "N"
newi.add_accelerator "activate", agr, key, mod, Gtk::AccelFlags::VISIBLE

I understand this Gtk::Accelerator stuff may be deprecated, but I don't know Gtk enough to bypass this lacks. What kind of objects are supposed to be passed to add_accelerator method ?

Upvotes: 0

Views: 73

Answers (1)

ralf
ralf

Reputation: 66

key, mod = Gtk::accelerator_parse("N")

Upvotes: 2

Related Questions