O'Reilly logo

Mastering Perl/Tk by Nancy Walsh, Stephen Lidie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listbox Options

As with any of the widgets, you can configure the Listbox using options. The standard widget options are -cursor, -font, -height, -highlightbackground,-highlightcolor, -highlightthickness, -takefocus, -width, -xscrollcommand, and -yscrollcommand. The options specific to Listbox widgets will be further discussed later in this chapter.

-background => color

Sets the color of the area behind the text.

-borderwidth => amount

Sets the width of the edges of the widget. Default is 2.

-cursor => cursorname

Sets the cursor to display when the mouse is over the Listbox.

1

Determines if the current Listbox selection is made available for the X selection as well. If set to 1, prevents two Listboxes from having selections at the same time.

-font => fontname

Sets the font of any text displayed within the Listbox.

-foreground => color

Sets the color of nonselected text displayed in the Listbox.

-height => amount

Sets the height of the Listbox.

-highlightbackground => color

Sets the color the highlight rectangle should be when the Listbox does not have the keyboard focus.

-highlightcolor => color

Sets the color the highlight rectangle should be when the Listbox does have the keyboard focus.

-highlightthickness => amount

Sets the thickness of the highlight rectangle. Default is 2.

-relief => 'flat'|'groove'|'raised'|'ridge'|' sunken '|'solid'

Sets the relief of the edges of the Listbox.

-selectbackground => color

Sets the color behind any selected ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required