Skip to Main Content
Learning Perl/Tk
book

Learning Perl/Tk

by Nancy Walsh
January 1999
Beginner content levelBeginner
373 pages
9h 43m
English
O'Reilly Media, Inc.
Content preview from Learning Perl/Tk

7.4. Colors

In most widgets there is a -background and a -foreground color. In addition to those, we also have the -selectbackground and the -selectforeground color options in a listbox. When a listbox entry is selected, it appears in a different color.

Although you can change the color of the selected text, you can only use one color. You cannot make different lines in the listbox different colors.

Figure 7.1. Examples of -foreground, -background, -selectforeground, and -selectbackground

In Figure 7.1, the listbox on the left has -foreground => 'red', -background => 'green'. The listbox on the right has -selectforeground => 'red', -selectbackground => 'green'. Make sure that the foreground and background values contrast with each other if you change these options.

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

Mastering Perl/Tk

Mastering Perl/Tk

Stephen Lidie, Nancy Walsh

Publisher Resources

ISBN: 1565923146Supplemental ContentCatalog PageErrata