def setup(app, i)
y = i / 4
x = i % 4
self.set({:x => x * PIECE_SIZE,
:y => y * PIECE_SIZE})
Gnome::CanvasRect.new(self,
{:x1 => 0.0,
:y1 => 0.0,
:x2 => PIECE_SIZE,
:y2 => PIECE_SIZE,
:fill_color => get_piece_color(x, y),
:outline_color => "black",
:width_pixels => 0})
@text = Gnome::CanvasText.new(self,
{:text => i.to_s,
:x => PIECE_SIZE / 2.0,
:y => PIECE_SIZE / 2.0,
:font => "Sans bold 24",
:anchor => Gtk::ANCHOR_CENTER,
:fill_color => "black"})
@num = i
@pos = i
self.signal_connect("event") do |item, event|
app.piece_event(item, event)
end
end