# Bugs in Examples

**URL:** <https://www.ruby-forum.com/t/bugs-in-examples/238235>\
**Category:** Ruby-Gnome 2\
**Created:** [December 26, 2013, 9:23pm UTC](https://www.ruby-forum.com/t/bugs-in-examples/238235 "2013-12-26T21:23:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [December 26, 2013, 9:23pm UTC](https://www.ruby-forum.com/t/bugs-in-examples/238235/1 "2013-12-26T21:23:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thorx89\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a4c791/32.png) [@thorx89\_S](https://www.ruby-forum.com/u/thorx89_S)\
**Post date:** [December 31, 2013, 10:50pm UTC](https://www.ruby-forum.com/t/bugs-in-examples/238235/2 "2013-12-31T22:50:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![thorx89\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/a4c791/32.png) [@thorx89\_S](https://www.ruby-forum.com/u/thorx89_S)\
**Post date:** [January 1, 2014, 3:55am UTC](https://www.ruby-forum.com/t/bugs-in-examples/238235/3 "2014-01-01T03:55:21Z")

</div>

Ok. It’s fixed, and v 1.0.16 has been pushed ro [rubygems.org](http://rubygems.org).

Thanks!

Eric
