Thanks for reporting this! It's a bug.
The widget proc called by an alias does an eval $cmd whereas it should do
an uplevel $cmd.
Because of this, the variable gets stored inside the widget proc instead of
at the level where the search command is issued.
CG
|--------+------------------------------------->
| | Eric Taylor |
| | <[EMAIL PROTECTED]> |
| | Sent by: |
| | [EMAIL PROTECTED]|
| | eforge.net |
| | |
| | |
| | 12/20/2001 07:36 PM |
| | |
|--------+------------------------------------->
>-----------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc:
|
| Fax to:
|
| Subject: [vtcl-user] text widget alias: command does not always work
|
|
|
>-----------------------------------------------------------------------------------------------------------|
I have a text widget and an alias (textout) set to it. Trying to
do a text widget search only 1/2 works, it does not process the
variable after -count as shown below using the console:
(Desktop) 28 % textout search -regexp -count myvar "1793" 1.0 end
2.5
(Desktop) 29 % set myvar
can't read "myvar": no such variable
(Desktop) 30 % set widget(textout)
.top17.fra19.fra21.fra23.03
(Desktop) 31 % .top17.fra19.fra21.fra23.03 search -regexp -count myvar
"1793" 1.0 end
2.5
(Desktop) 32 % set myvar
4
(Desktop) 35 % $widget(textout) search -regexp -count myvar2 "1793" 1.0 end
2.5
(Desktop) 36 % set myvar2
4
Using either the actual path or the widget reference works though.
Is there something I am doing wrong, or is it something to do with
how the widget alias becomes a command?
eric
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/vtcl-user
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/vtcl-user