O'Reilly logo

Sams Teach Yourself Ruby in 21 Days by Mark Slagell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modular Design for Multiple Windows

Most GUI programs will work with more than one window. When you're used to traditional text-based programming, it can be a little tricky to get your head around the logic of making windows come and go in an event-driven environment, but if you organize your code using the trick you are about to learn, it should begin to make perfect sense.

Window Subclasses and Test Code

When designing a window, we never write code to create a Gtk::Window directly; instead we write a subclass of Gtk::Window and instantiate that subclass. (The same idea applies when working with other Gtk classes, as you'll see.) This involves just a little extra overhead, compared to what we've been doing. Each new class will go in a file that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required