[GiDlist] combobox in tcl-file
Posted: Tue Jan 07, 2003 1:52 pm
hi everybody,
I've created a tcl-file for a problemtype that allows me to generate geometric entities from a window called "Geometry" with the procedure "Geometry". I need to create a sort of combobox widget inside this window with three standard values between which the user has to choose. I tried to do that with the listbox widget as described in the standard tcl-documentation, but I couldn't manage to assign the currently selected value of the listbox to a global variable so as to use this information later on in the procedure "Draw". So I had to create three checkbuttons that can be turned on and off, but this solution is not satisfying, because I don't know how to deselect the other two buttons when one of the checkbuttons is selected.
This is how looks my tcl-file now:
...
proc Geometrie {} {
global GeometriePriv
set w .gid.geometrie
InitWindow $w "Geometrie" GeometryWindow
frame $w.title
label $w.title.belastungsArt -text " Belastungsart "
frame $w.check
label $w.check.sLt -text " schlaffe Last "
checkbutton $w.check.sLcb -variable GeometriePriv(sL)
label $w.check.sPt -text " starre Plate "
checkbutton $w.check.sPcb -variable GeometriePriv(sP)
label $w.check.ePt -text " elastische Platte "
checkbutton $w.check.ePcb -variable GeometriePriv(eP)
if { $GeometriePriv(sL) } { $w.check.sPcb deselect
$w.check.ePcb deselect }
if { $GeometriePriv(sP) } { $w.check.sLcb deselect
$w.check.ePcb deselect }
if { $GeometriePriv(eP) } { $w.check.sLcb deselect
$w.check.sPcb deselect }
...
These last if-commands do not work instantly. In fact, what I need is a combobox like the ones implemented in the configuration files with the command:
QUESTION: Belastung#CB#(one,two,three)
VALUE: one
Then I need to store the currently selected value in a variable so I can use it in another procedure.
Can anybody help?
thanks, Andreas
Andreas
--
http://www.berlin.de - meine stadt im netz.
***********************************************************************
Nur 1 x Anmelden für 600 Warenproben und Gutscheine wie z.B. edle Shampoos, Zigarretten, CD´s, Süßigkeiten, Parfüms, Tiernahrung und vieles vieles mehr Jetzt unverbindlich informieren: http://www.probenwelt.de/partner/?id=33
***********************************************************************
I've created a tcl-file for a problemtype that allows me to generate geometric entities from a window called "Geometry" with the procedure "Geometry". I need to create a sort of combobox widget inside this window with three standard values between which the user has to choose. I tried to do that with the listbox widget as described in the standard tcl-documentation, but I couldn't manage to assign the currently selected value of the listbox to a global variable so as to use this information later on in the procedure "Draw". So I had to create three checkbuttons that can be turned on and off, but this solution is not satisfying, because I don't know how to deselect the other two buttons when one of the checkbuttons is selected.
This is how looks my tcl-file now:
...
proc Geometrie {} {
global GeometriePriv
set w .gid.geometrie
InitWindow $w "Geometrie" GeometryWindow
frame $w.title
label $w.title.belastungsArt -text " Belastungsart "
frame $w.check
label $w.check.sLt -text " schlaffe Last "
checkbutton $w.check.sLcb -variable GeometriePriv(sL)
label $w.check.sPt -text " starre Plate "
checkbutton $w.check.sPcb -variable GeometriePriv(sP)
label $w.check.ePt -text " elastische Platte "
checkbutton $w.check.ePcb -variable GeometriePriv(eP)
if { $GeometriePriv(sL) } { $w.check.sPcb deselect
$w.check.ePcb deselect }
if { $GeometriePriv(sP) } { $w.check.sLcb deselect
$w.check.ePcb deselect }
if { $GeometriePriv(eP) } { $w.check.sLcb deselect
$w.check.sPcb deselect }
...
These last if-commands do not work instantly. In fact, what I need is a combobox like the ones implemented in the configuration files with the command:
QUESTION: Belastung#CB#(one,two,three)
VALUE: one
Then I need to store the currently selected value in a variable so I can use it in another procedure.
Can anybody help?
thanks, Andreas
Andreas
--
http://www.berlin.de - meine stadt im netz.
***********************************************************************
Nur 1 x Anmelden für 600 Warenproben und Gutscheine wie z.B. edle Shampoos, Zigarretten, CD´s, Süßigkeiten, Parfüms, Tiernahrung und vieles vieles mehr Jetzt unverbindlich informieren: http://www.probenwelt.de/partner/?id=33
***********************************************************************