Class: App

Inherits:
Object show all
Defined in:
lib/drx/tk/imagemap.rb

Overview

A little demonstration.

Instance Method Summary collapse

Constructor Details

#initializeApp

:nodoc:



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/drx/tk/imagemap.rb', line 265

def initialize
  @root = TkRoot.new
  im = TkImageMap::ImageMap.new(@root)
  im.pack :expand => true, :fill => 'both'
  im.image = 'a.gif'
  im.image_map = 'a.map'
  im.select_command { |url|
    if url
      puts 'clicked: ' + url
    else
      puts 'cleared'
    end
  }
  im.double_select_command { |url|
    puts 'going to ' + url
  }
  btn = TkButton.new @root
  btn.pack
  btn.command {
    p 'button clicked'
    im.active_url = 'http://server/obj/o_1224289036'
  }
end