What Is Tk?

Tk is a “graphic toolkit,” something that lets your Ruby programs interact with the user by means of windows, dialogs, buttons, drop-down menus, and the rest of the paraphernalia we all associate with user-friendly applications.

Before trying to understand why Ruby/Tk works the way it does, you should become aware of a little bit of history, because Tk was not originally written for Ruby. The story of Tk starts with a scripting language named Tcl (“Tool Command Language”), which was created by John Ousterhout in 1988. Tk was created to lend GUI functionality to Tcl.

For years, it was most common to hear Tcl and Tk mentioned together, even written Tcl/Tk almost as if they were one thing. But they are really separate from each other, ...

Get Sams Teach Yourself Ruby in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.