Indices

Many of the widget commands for listboxes take one or more indices as arguments. An index specifies a particular element of the listbox, in any of the following ways:

number
Specifies the element as a numerical index, where 0 corresponds to the first element in the listbox.
active
Indicates the element that has the location cursor. This element will be displayed as specified by -activestyle when the listbox has the keyboard focus, and it is specified with the activate widget command.
anchor
Indicates the anchor point for the selection, which is set with the selection anchor widget command.
end
Indicates the end of the listbox. For most commands this refers to the last element in the listbox, but for a few commands such as index and insert it refers to the element just after the last one.
@x,y
Indicates the element that covers the point in the listbox window specified by x and y (in pixel coordinates). If no element covers that point, then the closest element to that point is used.

In the widget command descriptions below, arguments named index, first, and last always contain text indices in one of the above forms.


© Author | Home | Sitemap