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.
|
Get Learning Perl/Tk now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.