Re: Speedup canvas itemconfigure -fill for many polygons.



On Mar 31, 5:13 pm, Mats <mats...@xxxxxxxxx> wrote:
On 31 Mar, 16:24, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:

On Mar 31, 1:59 pm, Mats <mats...@xxxxxxxxx> wrote:

Well, to answer this one I'd add a third hashtable
mapping (tag,item)->position-in-list. Granted, that
means additional housekeeping, but all operations then are O(1).

Do you think you can explain a bit more?
Can I create a hash entry with two keys, or do
I just combine them somehow to a single key?

Just combine. "$tag,$id" should do the job since ids contain only
digits (hence no comma). In Tcl pseudo-code:

As a TCL_STRING_KEYS

Yes, concatenated in a string key.

-Alex
.