someone gave me this code
package require Tk
namespace eval ::scale {
variable x 0
variable y
}
proc ::scale::start {input} {
variable y
set y [.c canvasy $input]
}
proc ::scale::motion {input} {
variable x
variable y
set new_y [.c canvasy $input]...
pack [canvas .c -width 100 -height 20 -bd 1 -relief solid] -side top
.c conf -scrollregion [.c bbox all]
bind .c <ButtonPress-1><Motion> { .c delete num ;.c create text 50 10 -text [.c canvasy %y] -tag num -justify center}
the problem with this code is:
i have to right click to stop the motion...
hi all
i would like to have a canvas who act like a scale
for example:
a rectangle is displayed
on entering with the mouse on a scrollregion, a text show a value -from (x) -to (x), growing when mouse go up, and decreasing when mouse go down.
how can i do that?
many thanks
nicolas
hi bong
the filter is done with - sign
in words :
1)look for number with - sign
2)remove all number equal to those with the - sign
3) remove number with - sign
if i have
+1 +2 +6 +200 +4 +9 +73 -6 -73
the result should be
1 2 200 4 9
someone helped me for this job
one result is
%...
hi
i'm looking for a way to do this job:
i've got +1 +2 +3 +4 +5 +6 -2 -4
i want 1 3 5 6
or +1 +4 +6 +3 +5 +2 -1 -3
want 4 6 5 2
any ideas are welcome
thanks
nicolas
hi there
i would like to use the following counter proc for many scales.
it works for one but how can i do for several ones....
the spinbox value is the time of counting in ms
any idea?
many thanks
nicolas
#!/bin/sh
wm title . "go"
namespace eval var {
variable valp ""
variable vals ""...
hi there
does someone can explain me how to deal with the exec command.
i'm running mac osx version of tcl.
i'm using tcl as a gui for a program who runs with no-gui, so i need to launch the program when i launch the tcl script.
the name of the no-gui program is pd.
when i use
exec...
ok for the number as name variables, i will change that
i've used "" instead of {} and it works, but, it still don't go back to 0 when i depress the button....
also i don't bind the buttonpress event to the button but to the scale...
thanks for the past tips (and the new ones)
nico
well, here's the lines
set 1 [lindex $sp 0]
set 2 [lindex $sp 1]
bind . <ButtonPress-1> {$Dlightsub::local.$1.[expr ([string map {0 {10}} $2] - 1)] set 100}
$Dlightsub::local.$1.[expr ([string map {0 {10}} $2] - 1)] is the name of the scale is want to set to 100 when i press the associated...
hi bong
i don't know how to set a variable to 100 on buttonpress and back to 0 on buttonrelease
if i put 2 bind:
bind . <ButtonPress-1> [set x 100]
bind . <ButtonRelease-1> [set x 0]
nothing happen when i click......
what do u think about that?
++
nico
hi bong
once again you were right, i've made
for {set r 0} {$r<$numRows} {incr r} {
pack [frame $Dlightsub::local.$r] -side top
pack [frame $Dlightsub::local.f$r] -fill x -in $Dlightsub::local.$r
for {set i 0} {$i<10} {incr i} {
pack [scale...
hi bong
hi others
i'm still using your proc for displaying many scale (a little bit modified).
i've just remove a part for the < 10 number (now, the only choice is x*10)
here's the proc
proc MakeSub {} {
#a frame for the scales
destroy $Dlightsub::local
pack [frame...
hi bong
it works, but with 1.0 1.end , the first line is red
with 2.0 2.end , both firsst and second line are red
should i add another line like
$k tag add <tag name> (X-1).0 (X-1).end
$k tag configure <tag name> -background white
++
nico
hi
how to give a color red for a line of a textwidget selected with
[lindex [split $k \n] $spin]
where $k is the text and $spin is the selected line
??
thanks
nico
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.