spinbox entry bindings
From: Chris vK (cvonkoss_at_yahoo.com.au)
Date: 02/01/05
- Next message: Schelte Bron: "Re: spinbox entry bindings"
- Previous message: randy1200: "Re: Interfacing Tcl/Tk GUI to existing C code"
- Next in thread: Schelte Bron: "Re: spinbox entry bindings"
- Reply: Schelte Bron: "Re: spinbox entry bindings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 1 Feb 2005 04:07:16 -0800
--My spinbox seems out of sync with my entry box ??
--I need to <ButtonRelease-1> twice to get the entry box to change
values, but then appears out of sync.
--I have an array of satellites and their longitude, in satlong.
array set satlong {\
sat1 long1 \
sat2 long2 \
}
--I get a list of satellite names from this array ...
foreach {sat long} [array get satlong] {
lappend satlist $sat
}
--I then use the list of sat names for values of my spinbox...
spinbox .sat -values $satlist -font {-size 12} -wrap 1 -state readonly
-textvariable sat
--Then, I try to bind the spinbox selected value to an entry box
textvariable...
bind .sat <ButtonRelease-1> { set satellitelong $satlong($sat) }
--Entry box where users can manualy enter values, into textvariable
satellitelong...
entry .satlong -font {-size 12} -width 10 -validate key \
-vcmd {expr {[string is double %P] && [string length %P]<7}} \
-textvariable satellitelong
--I also bind the entry box to another proc, wich works fine...
bind .satlong <Return> { calculate }
-- --Can anyone suggest how I need to bind the spinbox to the entry box so that it will be in sync ?? --Bind actions, <Leave> and <Motion> both work, but not when you click the spinbox up / down arrow buttons ?? --
- Next message: Schelte Bron: "Re: spinbox entry bindings"
- Previous message: randy1200: "Re: Interfacing Tcl/Tk GUI to existing C code"
- Next in thread: Schelte Bron: "Re: spinbox entry bindings"
- Reply: Schelte Bron: "Re: spinbox entry bindings"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|