Re: Speedup canvas itemconfigure -fill for many polygons.



On Mar 30, 3:46 pm, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
On Mar 30, 5:18 pm, max vorticity <max.vortic...@xxxxxxxxxxx> wrote:

[...] when I add the
itemconfigure command, it slows way down. I'm already using the canvas
id in the canvas itemconfigure command (using a tag is woefully
slow).

What exactly is slow with a tag ?
For example, if you do [.c itemconfigure all -fill red], is it slow ?
If not, then the next question is, can you afford to associate one tag
to each separate colour (assuming you can quantize them a bit), and do
the tag-juggling fast enough (is addtag/removetag slow ?) ?

-Alex

I had an error in my analysis so the slowness is not really
attributable to the itemconfigure command. So forget my original post
except that when using a lot of tags, it is much slower to address the
items by individual tags for each polygon than by the original canvas
id (using the all tag to change colors works with no noticable
delay). For instance, take a 2-d array of data and make a tag based
on the xy coordinate. Using a this tag to address the canvas item
instead of the canvas id was much slower. Addressing only a few items
by tags at a time in an interactive display is not really noticable.
However, if you need to change a very large number of items at once,
id's appears to be noticably faster. My application has over 80000
canvas items and I amazed at how well the canvas does.
.



Relevant Pages

  • Re: Tk::Canvas (i) how to get an id? (ii) vertical text?
    ... First question to you: given a Canvas tag, how to find the id's of the ... Here is a Zinc rotate text. ...
    (comp.lang.perl.tk)
  • Canvas undo: how many tags can I use?
    ... uses the Tk canvas as its drawing surface, ... the same geometry machinery to render its output on other ... for the canvas, that need to be kept in step; ... as I construct it in the geometry system; that tag can ...
    (comp.lang.tcl)
  • Re: Speedup canvas itemconfigure -fill for many polygons.
    ... Best would be to rewrite the canvas tag code to use hash tables ... I had to rewrite the storage for the tags while switching to object ...
    (comp.lang.tcl)
  • Re: creating GUI of lines
    ... The man page for canvas is a good start :-) and the book ... and not collectively).can u pls guide me in how i can use the tag ... but also to use the second tag ... DOULOS - Developing Design Know-how ...
    (comp.lang.tcl)
  • Re: Speedup canvas itemconfigure -fill for many polygons.
    ... id in the canvas itemconfigure command (using a tag is woefully ... What exactly is slow with a tag? ... the tag-juggling fast enough (is addtag/removetag slow ?)? ...
    (comp.lang.tcl)