Indices

Many of the widget commands for spinboxes take one or more indices as arguments. An index specifies a particular character in the spinbox's string, in any of the following ways:

number
Specifies the character as a numerical index, where 0 corresponds to the first character in the string.
anchor
Indicates the anchor point for the selection, which is set with the select from and select adjust widget commands.
end
Indicates the character just after the last one in the spinbox's string. This is equivalent to specifying a numerical index equal to the length of the spinbox's string.
insert
Indicates the character adjacent to and immediately following the insertion cursor.
sel.first
Indicates the first character in the selection. It is an error to use this form if the selection isn't in the spinbox window.
sel.last
Indicates the character just after the last one in the selection. It is an error to use this form if the selection isn't in the spinbox window.
@number
In this form, number is treated as an x-coordinate in the spinbox's window; the character spanning that x-coordinate is used. For example, ``@0'' indicates the left-most character in the window.

Abbreviations may be used for any of the forms above, e.g. ``e'' or ``sel.f''. In general, out-of-range indices are automatically rounded to the nearest legal value.


© Author | Home | Sitemap