Forum: Ruby-Gnome 2 Bugs in Examples

56d88bfe5d2dfc37f2f90e73772ed3e2?d=identicon&s=25 ThorX89 .. (thorx89_)
on 2013-12-26 21:23
Yesterday, I installed vr via rubygems on my 64bit Linux Mint 13
(~Ubuntu 12.04) with ruby-2.0.0-p247 installed via rvm, and the
calculator example and the child_window example crash when I click on
the buttons.

As for the calculator example, it's caused by trivial typos in
'bin/Calculator.rb' which are easily fixed by modifying the
keys__clicked method to look as follows:

  def keys__clicked(button)
    case button.label
      when "C" then @builder["display"].text = ""
      when "=" then
        begin # this doesn't catch all errors
           @builder["display"].text =
eval(@builder["display"].text).to_s
        rescue
          @builder["display"].text = "error"
        end
      else @builder["display"].text = @builder["display"].text +
button.label
    end
  end

I don't have any nonhacky fix for the child_window example.

Cheers
ThorX89
D9ba13de4e62fcabffa4403731434e42?d=identicon&s=25 Eric C. (eric_c65)
on 2013-12-31 22:50
Hi:

Thanks for reporting this.  You're right.  There is a typo in the
Calculator example:

@builder["display.text"]

Should be:

@builder["display"].text

I will fix it in the next release.

I'm checking on the other one now.

Eric
D9ba13de4e62fcabffa4403731434e42?d=identicon&s=25 Eric C. (eric_c65)
on 2014-01-01 03:55
Ok.  It's fixed, and v 1.0.16 has been pushed ro rubygems.org.

Thanks!

Eric
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.