Re: How can I pass variable throught "-command"
- From: Ralf Fassel <ralfixx@xxxxxx>
- Date: Fri, 11 Nov 2005 18:13:42 +0100
* Arndt Roger Schneider <roger.schneider@xxxxxxxxx>
| i've used both; right-now i do prefer subst:
|
| scrollbar $cur_win1.sb1 -command [subst {$cur_win1.txt2 yview}]
Makes the reviewer wonder `why doesn't he use the standard idiom'?
Again, if $cur_win1 should contain special charcters, this will fail.
set cur_win1 {.foo bar}
toplevel $cur_win1
text $cur_win1.txt2
scrollbar $cur_win1.sb1 -command [subst {$cur_win1.txt2 yview}]
pack $cur_win1.txt2 $cur_win1.sb1
Invoking the scrollbar gives you
ambiguous command name ".foo": {.foo bar} {.foo bar.sb1} {.foo bar.txt2}
while executing
".foo bar.txt2 yview -1"
("uplevel" body line 1)
invoked from within
Pray that nobody names their widgets
set cur_win1 {.foo [exec rm -f $::env(HOME)]}
When using 'list', all this is a non-issue.
R'
.
- Follow-Ups:
- Re: How can I pass variable throught "-command"
- From: Arndt Roger Schneider
- Re: How can I pass variable throught "-command"
- References:
- How can I pass variable throught "-command"
- From: Hans
- Re: How can I pass variable throught "-command"
- From: Donal K. Fellows
- Re: How can I pass variable throught "-command"
- From: Arndt Roger Schneider
- How can I pass variable throught "-command"
- Prev by Date: Re: Expect: binary data over socket
- Next by Date: Re: Segmentation Fault help requested
- Previous by thread: Re: How can I pass variable throught "-command"
- Next by thread: Re: How can I pass variable throught "-command"
- Index(es):
Relevant Pages
|