For Programmers: Free Programming Magazines  


Home > Archive > Tcl > June 2005 > multi-scale









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author multi-scale
nicolas

2005-06-07, 9:00 am

hi
this is my second code.......

how to do to get the value of each scale separatly?

very thanks for the help
nicolas

wm title . "SUBS"


frame .0
pack .0 -side left -fill x

set f 0

frame .top -borderwidth 10
pack .top -side left -fill x

spinbox .top.circ -textvariable circ -from 0 -to 512 -increment 1
-width 5
bind .top.circ <Return> {focus .top; puts $circ;}

button .top.go -text "go" -width 5 -height 3 -borderwidth 20 -command {

while {$f<$circ} {
scale .top.$f -orient vertical -from 100 -to 0 -length 100 -width 10
-variable sub$f
pack .top.$f -side left
incr f}
puts "ok $circ"
}

pack .top.circ .top.go

Kaitzschu

2005-06-07, 9:00 am

On Tue, 7 Jun 2005, nicolas wrote:

> hi
> this is my second code.......
>
> how to do to get the value of each scale separatly?


for {set i 0} {$i < $circ} {incr i} {puts [set ::sub$i]}

Having absolutely no error-checking (fails when you increase spinbox's
counter without hitting GO (although, hitting GO again will fail anyhow
but I'm guessing this isn't your true code, but an example) and using too
many globals.

> wm title . "SUBS"
>
>
> frame .0
> pack .0 -side left -fill x
>
> set f 0
>
> frame .top -borderwidth 10
> pack .top -side left -fill x
>
> spinbox .top.circ -textvariable circ -from 0 -to 512 -increment 1
> -width 5
> bind .top.circ <Return> {focus .top; puts $circ;}
>
> button .top.go -text "go" -width 5 -height 3 -borderwidth 20 -command {
>
> while {$f<$circ} {
> scale .top.$f -orient vertical -from 100 -to 0 -length 100 -width 10
> -variable sub$f
> pack .top.$f -side left
> incr f}
> puts "ok $circ"
> }
>
> pack .top.circ .top.go


--
-Kaitzschu
s="TCL ";while true;do echo -en "\r$s";s=${s:1:${#s}}${s:0:1};sleep .1;done
nicolas

2005-06-07, 9:00 am

ok it works, many thanks
now i'll try to get the result when i move scale and not binded with go
button

best regards
nicolas

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com