Tk-CANVAS2
En este caso creamos una pirámide invertida de dos colores
require "tk"
module TkItemConfigOptkeys
def itemconfig_hash_kv(id, keys, enc_mode = [], conf = []) # Esto es necesario para que funcione
hash_kv(__conv_item_keyonly_opts(id, keys), enc_mode, conf)
end
end
@canvas = TkCanvas.new
#TkcRectangle.new(canvas, '1c', '2c', '3c', '3c', 'outline' => 'red', 'fill' => 'yellow')
for i in (0...100)
i += 1
TkcLine.new(@canvas, i, 0, 100, 100, 'width' => '2', 'fill' => 'red')
TkcLine.new(@canvas, i+100, 0, 100, 100, 'width' => '2', 'fill' => 'blue')
@canvas.pack
end
Tk.mainloop