::EVB::utility::sortedPair -- Key value pair widget


package require EVButilities

EVB::utility::sortedPair window ?options?

$window configure options

$window cget ?option-name

$window setItem key value

$window clear ?value?

$window reinit

$window idlist


This is a utility widget that provides a dynamic scrolling list of label pairs. The value in the left label in each pair is called the key. The list is maintained sorted by key values.

Use cases for this widget are for a set of counters that are associated with some set of things (in the event fragment sorter e.g. the source id).



Supplies a title for the top of the widget. This title is text that is intended to show what the widget is for.


Provides a title for the left column (the column of key values).


Provides the title for the right column (the column of values associted with the key).


$window setItem key value

Defines a key/value pair. If the key already exists, the label associated with the key is just modified. If the key does not exist, a new pair of labels is created with the specified key and value.

$window clear ?value?

Sets all of the value labels to value if that optional paremeter is specified. If not, all value labels are set to 0, the key labels are not affected by this.

$window reinit

Reinitializes the widget so that there are no key/value pairs.

$window idlist

Returns a list of the key values present in the widget.