require 'tkmove3.rb' include TestBed TkRoot.new{title 'gettags'} c = TkCanvas.new.pack testbed( c ) msg = TkMessage.new(nil, 'width'=>300).pack('fill'=>'x') TkButton.new(nil, 'text'=>"c.gettags( 'current' )", 'command'=>proc{ c.dtag('selected') c.bind('B1-Motion', proc{}) c.bind('1', proc{ msg.text( c.gettags('current').inspect ) }) }).pack Tk.mainloop