Part III. Perl/Tk

The eight articles in this section provide an introduction to Perl/Tk, Perl’s full-featured and popular toolkit for developing graphical applications. It works on both Unix/Linux and Windows, and most Perl/Tk applications will run without change in both environments.

Perl/Tk programming is different enough from regular Perl programming that it sometimes strikes newcomers as hard to learn. It doesn’t have to be, though; there are really just three broad concepts that you have to keep in mind, and my A Perl/Tk Roadmap article describes them. Steve Lidie follows with an introduction to the basics of Perl/Tk programming in Getting Started with Perl/Tk, and I walk through the creation of a quick and dirty Perl/Tk application in Scoreboard: A 15-Minute Perl/Tk Application.

The rest of the section is all Steve. In The Mouse Odometer, he illustrates how you can add menus, timers, color selection, and widgets of your own devising to Perl/Tk applications. Next, in Events, he shows how your programs can respond to user actions such as keypresses, mouse clicks, or simply moving the mouse over an area of the application. The article also demonstrates the Photo widget and shows how to create animations, culminating in a crude implementation of a Breakout-style video game.

Geometry managers provide ways to organize spatial elements in your applications. The Pack and Grid Geometry Managers ...

Get Web, Graphics & Perl/Tk Programming 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.