tktable.array_var

ArrayVar, a tkinter variable for Tcl arrays, which a Table can store its cells in.

class tktable.array_var.ArrayVar(master=None, name=None)[source]

Bases: Variable

A Tcl array, the usual store for a Table’s cells (its variable option).

A Tcl array is an associative array, so this class supports some dict operations: cells are keyed by “row,col” indices, e.g. cells["0,1"] = "Hello".

Parameters:
  • master (Misc | None)

  • name (str | None)

names()[source]

Return the keys (indices) of the array.

Return type:

tuple[str, …]

get(key=None)[source]

Return the value at key, or all the array as a dict if key is None.

Parameters:

key (str | None)

Return type:

Any

set(**kw)[source]

Set the values of the given keys, e.g. set(**{"0,0": "a", "0,1": "b"}).

Parameters:

kw (Any)

Return type:

None

unset(pattern=None)[source]

Unsets all of the elements in the array. If pattern is given, only the elements that match pattern are unset.

Parameters:

pattern (str | None)

Return type:

None