From: Keith on 6 Feb 2010 02:06 On Fri, 05 Feb 2010 09:56:26 +0100, Uwe Klein wrote in r23t37-73l.ln1(a)klein-habertwedt.de: > Keith wrote: >> On Thu, 04 Feb 2010 23:13:24 +0100, Uwe Klein >> <uwe_klein_habertwedt(a)t-online.de> wrote: >> >> >>>Keith wrote: >>> >>>>I'm trying to use a spinbox to set a value that is retrieved from a >>>>string, the problem is that the spinbox value is not set to what the >>>>variable is: >>>> >>>> >>>you've trespassed into other language territory ;-) >>> >>>THEY will come to get you! >>> >>>replace >>> >>>>$ton(dly) = "INF" >>> >>>with >> >> global ton >> set ton(dly) "INF" >> set dly {0 1 2 5 10 30 INF} >> spinbox .l -values $dly -textvariable ton(dly) -state readonly >> -width 4 -wrap 1 >> pack .l >> >> >> Well I executed this in the tcl console and the 0 was what appeared. >> I'm >> using tcl8.5, if that makes a difference. > > I used 8.4, run at "global" level, but just tested my senile version of > 8.5 doesn't balk either. > > Does your code run inside a proc? > > <my script> > #!/usr/bin/wish > > > set ton(dly) "INF" > set dly {0 1 2 5 10 30 INF} > spinbox .l -values $dly -textvariable ton(dly) -state readonly > -width 4 -wrap 1 pack .l > > #end > > uwe What OS are you operating in? I have tried this in Win7 wish 8.5 & 8.4 with the same results and in Linux wish8.5 with 0 always be loaded by default. If i use set ton(dly) "INF" after I create the spinbox then the spinbox changes to INF, but having the variable set before the spinbox is created sets ton(dly) to 0. -- Best Regards, Keith http://home.comcast.net/~kilowattradio/
From: Uwe Klein on 6 Feb 2010 04:35 Keith wrote: > On Fri, 05 Feb 2010 09:56:26 +0100, Uwe Klein wrote in > r23t37-73l.ln1(a)klein-habertwedt.de: > > >>Keith wrote: >> >>>On Thu, 04 Feb 2010 23:13:24 +0100, Uwe Klein >>><uwe_klein_habertwedt(a)t-online.de> wrote: >>> >>> >>> >>>>Keith wrote: >>>> >>>> >>>>>I'm trying to use a spinbox to set a value that is retrieved from a >>>>>string, the problem is that the spinbox value is not set to what the >>>>>variable is: >>>>> >>>>> >>>> >>>>you've trespassed into other language territory ;-) >>>> >>>>THEY will come to get you! >>>> >>>>replace >>>> >>>> >>>>>$ton(dly) = "INF" >>>> >>>>with >>> >>>global ton >>>set ton(dly) "INF" >>>set dly {0 1 2 5 10 30 INF} >>>spinbox .l -values $dly -textvariable ton(dly) -state readonly >>>-width 4 -wrap 1 >>>pack .l >>> >>> >>> Well I executed this in the tcl console and the 0 was what appeared. >>> I'm >>>using tcl8.5, if that makes a difference. >> >>I used 8.4, run at "global" level, but just tested my senile version of >>8.5 doesn't balk either. >> >>Does your code run inside a proc? >> >><my script> >>#!/usr/bin/wish >> >> >>set ton(dly) "INF" >>set dly {0 1 2 5 10 30 INF} >>spinbox .l -values $dly -textvariable ton(dly) -state readonly >>-width 4 -wrap 1 pack .l >> >>#end >> >>uwe > > > What OS are you operating in? I have tried this in Win7 wish 8.5 & 8.4 > with the same results and in Linux wish8.5 with 0 always be loaded by > default. If i use set ton(dly) "INF" after I create the spinbox then the > spinbox changes to INF, but having the variable set before the spinbox is > created sets ton(dly) to 0. > Ahh. Linux. tcl/tk 8.5a3, but IMHO this should be a platform independent hitch. I seem to remember a change in how linking up a variable was effecting the displayed value, This may even have been a tipped thing. someone else may have more information? append to the example script update after 2000 set ton(dly) "INF" see what happens when you run it. uwe
From: Gerald W. Lester on 6 Feb 2010 11:43 Uwe Klein wrote: > Keith wrote: >>... >> >> What OS are you operating in? I have tried this in Win7 wish 8.5 & >> 8.4 with the same results and in Linux wish8.5 with 0 always be loaded >> by default. If i use set ton(dly) "INF" after I create the spinbox >> then the spinbox changes to INF, but having the variable set before >> the spinbox is created sets ton(dly) to 0. >> > > Ahh. > > Linux. tcl/tk 8.5a3, but IMHO this should be a platform independent hitch. > > I seem to remember a change in how linking up a variable was effecting > the displayed value, This may even have been a tipped thing. > > someone else may have more information? MacOS with Apple's 64 bit 8.5.7 displays 0 if the value is set before (at least until you resize the window). Sounds like you need to make a bug report. -- +------------------------------------------------------------------------+ | Gerald W. Lester | |"The man who fights for his ideals is the man who is alive." - Cervantes| +------------------------------------------------------------------------+
First
|
Prev
|
Pages: 1 2 Prev: Musings while learning Tcl by parsing XML with tDOM Next: when did mini.net go by the wayside? |