From: 7stud -- Date: 2008-05-10T16:41:43+09:00 Subject: Re: open web page from Ruby Tk app e deleflie wrote: > > - also, does anyone have any sample code on executing a proc on mouse > down in a TKlabel? > require 'tk' def on_button_press(e) widget = e.widget xcoord = e.x ycoord = e.y puts "button pressed, x:#{xcoord}, y:#{ycoord}" end root = TkRoot.new { title 'Label Test' geometry "600x400+200+50" } label = TkLabel.new(root) do text "click me" pack end label.bind('ButtonPress-1', lambda {|e| on_button_press(e)}) label.bind("ButtonRelease-1", proc{puts "button released"}) Tk.mainloop -- Posted via http://www.ruby-forum.com/.