| Bryan Oakley 2007-08-27, 8:34 pm |
| ZB wrote:
> Hallo,
>
> noticed a strange - but very interesting thing. Take a look at the following
> script:
>
> ================== cut =============
> #! /bin/sh
> # the next line restarts using wish \
> exec wish "$0" "$@"
>
> #label .foo
> for {set ii 0} {$ii < 20} {incr ii} {
> label .label$ii -text "label #$ii" -font "Helvetica 10"
> pack .label$ii
> puts $ii
> }
> ================== cut =============
>
> There is noticeable difference in filling the output window (look at the
> puts counter speed), when you either uncomment the #label .foo line - or
> delete the `-font "Helvetica 10" ' parameter from label definition.
Do you have really slow hardware? Or maybe you're running a *nix version
with an X11 font server on a different machine? The above code happens
in the blink of an eye on my windows box. When I time the code on my
box, both with and without the "label .foo", [time] reports it takes 0
microseconds (read: too fast to measure)
--
Bryan Oakley
http://www.tclscripting.com
|