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.5. Listbox Style

The default -relief of a listbox is 'sunken'. The default -borderwidth is 2. Figure 7.2 shows the five different relief types (flat, raised, ridge, groove, and sunken). In the first window, the default -borderwidth is used; in the second window, a -borderwidth of 4 is used. To save space in the windows, I didn't draw any scrollbars.

Figure 7.2. Examples of -relief and -borderwidth in listboxes

7.5.1. Style of Selected Items

There is also a borderwidth associated with any selected text. This is controlled by the -selectborderwidth option. Figure 7.3 shows what changing the selection borderwidth to 4 does to the listbox.

Figure 7.3. Example of -selectborderwidth => 4

Sidebar 1. Listbox Indexes

The items in an entry widget are ordered. The first listbox item is at index 0, and the numbers increment by 1. These values are valid for any of the methods that require an index value.

n

An integer index. The first item in a listbox is at index 0.

"active"

The index within the listbox that has the location cursor. If the listbox has the keyboard focus, it will be displayed with an underline.

"anchor"

This index is set with the selectionAnchor(...) method.

"end"

The end of the listbox. Depending on which method is using this index, it could mean just after the last element ...

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