From: Silkmoth Silkmoth Newsgroups: comp.lang.ruby Subject: Ruby Gtk2 and signal_connect method Date: Fri, 6 May 2011 14:09:51 -0500 Organization: Service de news de lacave.net Lines: 28 Message-ID: <14fe31c992d1702a259c05ab9ba0b550@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1304709056 42843 65.111.164.187 (6 May 2011 19:10:56 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Fri, 6 May 2011 19:10:56 +0000 (UTC) X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 382758 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <14fe31c992d1702a259c05ab9ba0b550@ruby-forum.com> Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!feed.ac-versailles.fr!talisker.lacave.net!lacave.net!not-for-mail Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:4050 Hi, I am writting a little script for displaying a list of icons and when i clic on one of the icon it should return the absolute path of the icon. So i create a windows widget which contain a table widget. In each cell of the table I put an icon and create an event with this code: #for a in 0..( @my_icons_files_array.length - 1) # my_widget =Gtk::Image.new(@my_icons_files_array[a]) # event_box[a] = Gtk::EventBox.new.add(my_widget) # event_box[a].signal_connect("button_press_event") do # ... # # end # table.attach(event_box[a],col_begin,( col_begin + 1 ), row_begin, (row_begin + 1 )) #end Is there a way to get a reference of the objet I have cliqued on in order to link this reference with the path used in Gtk::Image.new Thanks -- Posted via http://www.ruby-forum.com/.