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 IndexesThe 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.
|
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.
Read now
Unlock full access