Forum: Ruby-Gnome 2 uninitialized constant Gdk::Keyval::

8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2010-12-29 08:28
(Received via mailing list)
Hi,

I ran into the following: uninitialized constant Gdk::Keyval::GDK_F5
I have the following versions:
x11-libs/gtk+-2.22.1
dev-libs/glib-2.26.1
dev-ruby/ruby-gtk2-0.19.4
I understand that the constant naming is changed in newer GTK+.
How could i support newer and older constant namings? Should i use the
value instead?

Thanks in advice,
C4a836af7263f84a4f7cc91ed6f3ae77?d=identicon&s=25 Vincent Carmona (vinc-mai)
on 2010-12-31 03:00
(Received via mailing list)
2010/12/29 Dobai-Pataky Blint <dpblnt@gmail.com>:
>
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> ruby-gnome2-devel-en mailing list
> ruby-gnome2-devel-en@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ruby-...
>
>


Hi.

The old names should be valid under gnome 2. I think they will be
dropped in gnome 3.
If needed you can define the new constants.
Here is a small hack to be tested.

require 'gtk2'

module Gdk
module Keyval
  begin
    GDK_KEY_a
  rescue NameError
    constants.each{|key| const_set(''GDK_KEY_'+key[4..-1],
eval(key))}#TODO : compare string key to /^GDK_/
  end
end
end

--
Vincent Carmona
8e6374c0ef7b66942f34798e31edf014?d=identicon&s=25 "Dobai-Pataky Bálint" <dpblnt@gmail.com> (Guest)
on 2011-01-01 10:48
(Received via mailing list)
This resolved it.
Thanks Vincent
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.