The listbox widget

In Brief

This is a wrapper around the standard Tk listbox widget which provides Ttk/Tile focus styles, appropriate for whichever theme is active.


::tclmacbag::listbox pathName ?Options?

The following standard Tk options should not if used with this widget: -borderwidth, -highlightthickness, -background and -bg. These are handled internally by the metawidget according to the Tile/Ttk theme chosen.

Tk options: See The Tk listbox manual.


grid [::tclmacbag::listbox .lb -height 25 -width 70 -justify right]
.lb configure -justify left

Further Information

As is standard, ::tclmacbag::listbox returns with value of pathName, for ease of use with geometry managers like grid and pack.

From v0.09, the TclMacBag listbox is written using Snit. The result is: ${w}_Listbox should no longer be used to control the text portion of this megawidget using configure, etc. Use $w instead.

However, if binding to the <> event, you'll need to bind it to ${w}_Listbox.