Download by the right click on the link below
tkmove.rb - class library for draw program for Ruby/Tk tmdraw.rb - sample script for tkmove.rb tangram.rb - sample script of the antient Chinese puzzle $Date: 2002/06/02 by Tomokiyo Nomura
The scripts should be distributed under Ruby licence. The "tkmove.rb" is a class library which enable Ruby/Tk programmers to introduce "Draw" funtion to their own scripts. To use each class of the "tkmove.rb", only you have to do is to make an object of it and use the "bind" method. For example, the following script enable you to draw ovals on your TkCanvas. require 'tkmove.rb' c = TkCanvas.new.pack oval = TkdOval.new( c ) oval.bind Tk.mainloop This package includes "tkdraw.rb", the sample script which shows how to use "tkmove.rb" class library. Put it in the same directory of the "tkmove.rb" and type on the commandline, > ruby tkdraw.rb Because the script of the "tkdraw.rb" is very simple, you will be able to learn how to use the classes in the "tkmove.rb" class library easily. There is another sample program. Tangram.rb is an antient Chinese puzzle. You can move each piece by drugging mouse with the left button down. If you drug the mouse with the middle button down, the piece rotates clockwise along with the mouse motion to the left, or anticlockwise with the mouse motion to the right. A single click of the right button on the piece turns it over. Have fun.