Hi, 

From: MATTHEW REUBEN MARGOLIS <mrmargolis / wisc.edu>
Subject: GUI Toolkit questions
Date: Fri, 8 Oct 2004 04:08:51 +0900
Message-ID: <242bd3243436.243436242bd3 / wiscmail.wisc.edu>
> I need to be able to display a large grid of 300 tiles, each of which
> can have a different picture that can change during execution.  I will
> need to be able to treat these tiles as individual buttons or have some
> other easy way to keep track of which tile the mouse is currently
> over/clicking on.  I will also need to be able to create a tool
> window(possibly floating) that will contain all the tools that you can
> use to operate on the tile grid.
> 
> Cross platform(Windows, Linux, Mac OS X compatibility would be optimal.

Hmmm... I'm interested that. 

I append a sample script of Ruby/Tk to this mail. 
It's a little large because of image data. 
The script shows clickable tiles on a scrollable frame. 
Each tile has a configurable image and a configurable label.

However, if you must really support 300x300 tiles (total 90,000 tiles)
on only one frame, it is too heavy for the script. 
Probably, the limit of the script is a few thousands tiles 
(e.g. 50 x 40 = 2,000 tiles). 

                                  Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)
------------------------------------------
#!/usr/bin/env ruby

require 'tk'

class MapFrame < TkWindow
  include TkComposite

  #########################################

  @@borderwidth = 0
  @@highlightthickness = 0

  @@labelfont = ['courier', 6]
  @@label_bg = '#101010'
  @@label_fg = 'white'

  @@imgwidth  = 50
  @@imgheight = 50

  @@grid_pad  = 1
  @@frame_bg_color  = 'gray'

  #########################################

  def button_callback(x, y)
    # please override this method
    puts "Button #{x}x#{y} is clicked!!"
  end

  #########################################

  def initialize_composite(width, height)
    @width  = width
    @height = height

    # create canvas
    @h_scroll = TkScrollbar.new(@frame)
    @v_scroll = TkScrollbar.new(@frame)

    @canvas = TkCanvas.new(@frame)
    @canvas.xscrollbar(@h_scroll)
    @canvas.yscrollbar(@v_scroll)

    @path = @canvas.path

    TkGrid.rowconfigure(@frame, 0, :weight=>1, :minsize=>0)
    TkGrid.columnconfigure(@frame, 0, :weight=>1, :minsize=>0)
    @canvas.grid(:row=>0, :column=>0, :sticky=>:news)
    @h_scroll.grid(:row=>1, :column=>0, :sticky=>:ew)
    @v_scroll.grid(:row=>0, :column=>1, :sticky=>:ns)

    # create a bindtag to scroll the canvas (events are generated on buttons)
    btag = TkBindTag.new
    btag.bind('3', proc{|x,y| 
		@canvas.scan_mark(x - @canvas.winfo_rootx, 
				  y - @canvas.winfo_rooty)
	      }, '%X %Y')
    btag.bind('B3-Motion', proc{|x,y| 
		@canvas.scan_dragto(x - @canvas.winfo_rootx, 
				  y - @canvas.winfo_rooty)
	      }, '%X %Y')

    @base = TkFrame.new(@canvas, :background=>@@frame_bg_color)

    # create buttons
    @buttons = Array.new(@width){|x|
      Array.new(@height){|y|
	TkLabel.new(@base, 
		    :image=>TkPhotoImage.new(:width=>@@imgwidth, 
					     :height=>@@imgheight), 
		    :borderwidth=>@@borderwidth, 
		    :highlightthickness=>@@highlightthickness){|b|
	  bindtags(bindtags.insert(1, btag)) # to scroll the canvas

	  @label = TkLabel.new(b, :text=>"#{x} x #{y}", :font=>@@labelfont, 
			       :background=>@@label_bg, 
			       :foreground=>@@label_fg, 
			       :padx=>1, :pady=>0){
	    place(:anchor=>:s, :rely=>1.0, :y=>-1, :relx=>0.5)
	  }
	  def self.label; @label; end

	  grid(:row=>y, :column=>x, 
	       :padx=>@@grid_pad, :pady=>@@grid_pad, :sticky=>:news)
	}.bind('ButtonRelease-1', proc{button_callback(x,y)})
      }
    }

    @base_win = TkcWindow.new(@canvas, 0, 0, :window=>@base, :anchor=>:nw)

    Tk.update_idletasks
    @canvas.scrollregion(@base_win.bbox)
  end

  def [](idx)
    @buttons[idx]
  end
end

map = MapFrame.new(nil, 40, 30).pack

map[4][2].background('red')
map[3][2].background('red')
map[3][3].background('red')
map[4][3].background('red')

p map[3][5].label.text

map[2][4].image[:data] = <<'EOI'
R0lGODlhMgAyAPf/AA8SARMVCxQZDRocAxsbCxQXBBYVEhQcFBgXFRobExobGhUeGx4fIRwg
BBwhCx0iEhwjHBwoFB0kIR8oJSUeBiAeCiocDCEeESAfGyEfICIjByMjDSYpDSokDS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kiMFIKCAHmSycMQJUYYoOjCiMQJL0C8MHLjBUylQ4y+RGIfVYwWIkCkbhlShI5b
Ggw/YjQgkEOECBsdaHRqBAdLQAA7
EOI

map[4][1].image.copy(img)
map[4][2].image.copy(img)
map[5][1].image.copy(img)
map[5][2].image.copy(img)

#################################

Tk.mainloop