# The returned integer value

**URL:** <https://www.ruby-forum.com/t/the-returned-integer-value/189462>\
**Category:** Ruby-Gnome 2\
**Created:** [June 1, 2010, 1:10pm UTC](https://www.ruby-forum.com/t/the-returned-integer-value/189462 "2010-06-01T13:10:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [June 1, 2010, 1:10pm UTC](https://www.ruby-forum.com/t/the-returned-integer-value/189462/1 "2010-06-01T13:10:41Z")

</div>

there is tutorial,  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk-signals-more](http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk-signals-more)  
% irb --simple-prompt

> > require ‘gtk2’  
> > =\> true  
> > b = Gtk::Button.new(“hoge”)  
> > =\> #\<Gtk::Button:0x40a2a858 ptr=0x8237df8\>  
> > b.signal\_connect(“clicked”) { puts 1 }  
> > =\> 1  
> > b.signal\_connect(“clicked”) { puts 2 }  
> > =\> 2

what i get is different from tutorial,which is right?  
pt@pt-laptop:~$ irb  
irb(main):001:0\> require ‘rubygems’  
=\> true  
irb(main):002:0\> require ‘gtk2’  
=\> true  
irb(main):003:0\> b = Gtk::Button.new(“hoge”)  
=\> #\<Gtk::Button:0xb750b72c ptr=0x9114498\>  
irb(main):004:0\> b.signal\_connect(“clicked”) { puts 1 }  
=\> 9  
irb(main):005:0\> b.signal\_connect(“clicked”) { puts 2 }  
=\> 10  
irb(main):006:0\>

---

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [June 1, 2010, 1:48pm UTC](https://www.ruby-forum.com/t/the-returned-integer-value/189462/2 "2010-06-01T13:48:25Z")

</div>

Hi. I think the tutorial means that when you connect a signal  
you get an integer back. This integer is a tag to allow you to  
keep track of the signal handler. It doesn’t have to be 1 or 2.  
It can be anything. The number that is returned is the  
correct one.

It looks like you are making good progress. Unfortunately  
I had to work late tonight, so I couldn’t prepare anything for  
you. But it looks like you are doing very well by yourself.  
Please ask any questions that you want. I will try to help.

```
    MikeC
```
