Subject | : Bind Text Variable with an element in a list |
Date | : 2007/05/11(Fri) 14:46:43 |
Contributor | : WangWeizhen < > |
Hi, All. There's a problem while I bind TextVaiable with an e
lement in a list. Look at the script below:
At La
st section, I would like to bind the Variable in KBFText to s
trlist[1] and strlist[2]. While I click the Button to refresh
, the "str" and "strlist" both change. Bu
t only the Text which bind to "str" changes, the ot
her two which bind to "strlist" do not change.
Can you give some help?
There is a lo
ng list to show at realtime.
FFS;
w=KBMainFrame
["Date",f,Title->"SAD"];
b=Button[f,Te
xt->"Refresh",Command:>refresh];
strlist={"000","000"};
str = "0
00";
refresh:=(
str = DateString[];
strlist={DateString[],"It's "//DateString[]};
[str];
Print[strlist[1]];
Print[strlist[2]];
);
cf=KBFComponentFrame[f,
Add->{
KBFGroup[Text
->"Group1"],
KBFText[Text->"Time&q
uot;],
KBFText[Variable:>str],
KBFText[Variable:>
strlist[1]],
KBFText[Variable:>strlist[2]]
}
];
TkWait[];
Further more, can "For&q
uot; loop be used while bind Variables to KBFText?
like:
For[i=1,i<=10,i++,
KBFText[Variable:
>strlist[i]]];