Torsten Berg wrote:
> # make a treeview:
> ttk::treeview .t -columns {test}
> [...]
> # insert a value into the column:
> .t insert {} end -values 12
> # remove the column:
> .t configure -columns {}
> # insert another column:
> .t configure -columns {anothertest}
>
> Now, the value 12 inserted into the column 'test' will reappear
> in the new column 'anothertest' although it never was intended
> for that one.
>
> Is this an intended feature, or a bug?
This is a misfeature.
The "-columns" option should be treated as read-only. Set it
at widget creation time and do not ever change it. Changing
-columns after data has been added to the tree leads to
counterintuitive inconsistencies like the above.
You probably want to use "-displaycolumns" instead.
(In fact "-columns" initially was a read-only option,
and was only made modifiable at the request of an early
adopter. In retrospect he was probably looking for
"-displaycolumns" as well.)
--Joe English