Skip to Main Content
Perl in a Nutshell, 2nd Edition
book

Perl in a Nutshell, 2nd Edition

by Nathan Patwardhan, Ellen Siever, Stephen Spainhour
June 2002
Beginner content levelBeginner
759 pages
80h 42m
English
O'Reilly Media, Inc.
Content preview from Perl in a Nutshell, 2nd Edition

Colors and Fonts

Tk was originally created for the X Window System and is still primarily used in that environment. For this reason, it has inherited the font and color scheme used for the X Window System.

Colors that can be used with Tk widgets are identified either by an RGB value or by a name that has been associated with an RGB value. In general, it is easier to use a color name than an explicit RGB value. For a listing of the color names that are supported, see the rgb.txt file in your X distribution or use the showrgb command. (Most common color names are supported, so you can say things such as “red,” “pink,” “green,” and even “chartreuse” with confidence.)

Fonts are another matter. Under the X Window System, fonts are named things such as -adobe-helvetica-medium-o-normal -- 12-120-75-75-p-67-iso8859-1. Wildcards can make the fonts easier to use, but they’re still a mouthful. For a listing of fonts available for a particular X server, use the xlsfonts command. There are a few font “aliases” that have been defined for your convenience (such as fixed, 6x10, 9x15, etc.), and you might prefer to just stick to those.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl by Example, Fourth Edition

Perl by Example, Fourth Edition

Ellie Quigley
Perl Cookbook, 2nd Edition

Perl Cookbook, 2nd Edition

Tom Christiansen, Nathan Torkington
Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Learning Perl, 7th Edition

Learning Perl, 7th Edition

Randal L. Schwartz, brian d foy, Tom Phoenix

Publisher Resources

ISBN: 0596002416Errata Page