On Fri, 15 Sep 2000, Stef Pillaert wrote:
> Hello,
>
> I'm new to the list (and to Vtcl, Tcl/Tk), so sorry if this is a silly one:
>
> I have a canvas, and a scrollbar. When I use the "absolute" names (e.g.
> .top34.can31 and the like), I can manage to scroll the canvas. However, if I
> ggive both the canvas and the scrollbar an alias, and I use
> $widget(whatever_alias) in the scroll commands, vtcl complains about not
> knowing the variables and commands. However, when I run in test mode, it works
> (I can scroll the canvas!).
>
> Am I doing something wrong using those aliases? Or is there some kind of bug?
>
> Thanks,
>
> Stef.
The problem is probably that the $widget(somewhat) ... command is quoted by '{` and
`}`.
If you quote commands in that way the command is passed as it is written, i.e.:
the $widget(..) isn't expanded to .topXX.canYY....
Since the variable widget may be unknown in the context the command is called you will
get an error.
You need to expand the variable at parse-time.
Try using simple double-quotes instead of the braces or catenate the command and its
arguments
with concat or list.
Regards
Carsten
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/vtcl-user