From: Alexandre F. <ale...@gm...> - 2008-10-27 18:47:21
|
On Mon, Oct 27, 2008 at 6:26 PM, Andreas Leitgeb <av...@lo...> wrote: > On Mon, Oct 27, 2008 at 12:34:11PM +0000, tcl...@li... wrote: > "Alexandre Ferrieux" <ale...@gm...> wrote: >> Right, but TIP #97 is not comparable with these, because it is >> trivially emulatable in pure Tcl: >> proc imove {canvas tagOrId index dx dy} { >> set pos [.c index $tagOrId $index] >> set cc [.c coords $tagOrId] >> .c coords $tagOrId [lreplace $cc $pos $pos1 $x $y] > > Even if we didn't mention tagOrId values that hit more then > one item, searching an item by tag is *slow* (if there are > lots of items). So looking up the item for a tag three > times or just once might make a noticable difference. Oh of course, then assume my proposal is now: foreach id [.c find withtag $tagOrId] { ... all the rest with $id instead of $tagOrId ... } But this extra line of course makes it waaaaay too complex. Better to do everything at C level. Who cares about code size, complexity and redundancy these days ? -Alex |