Main
This is the wiki form of the original, allows other people to extend this tutorial. Apparently, it is still popular, despite its age.

I need to check the license of this document.
(In any case, reproduction in verbatim is allowed.)

Ruby/Tk Tutorial

HelloWorld SimpleWidgets BindingEvents MoreWidgets Scrollbars Menus MakeItBeautiful MoreInformation



So you found Ruby and liked it. Now you need a GUI toolkit. Be warned: gtk, Qt, fox and wx have Ruby bindings as well. Maybe those suit your needs better.

This tutorial is aimed at people that want to use Tk as toolkit with Ruby. It does not really matter whether you are very proficient in Ruby or with toolkits. Examples may overwhelm the novice sometimes, but each line is explained. Step over it and come back in a later stage. The small differences in those lines provide a wealth of information for the more experienced programmer.

Note: This is a work in progress. You are free to edit this wiki to improve it.

A few reasons to use Tk:

A few reasons not to use Tk

Installation Problems

If you installed Ruby yourself, possibly the Tk bindings do not work. First, make sure you have Tcl/Tk installed. Then look at a configuration fix.

The Course