how can i get a value form combobox GUI?
Hi all
I wrote this code for combobox. However when i change the list the results not.
I expect when this list's value changes, get the area and moi for selected beam sections.
Could you please help me?
hwtk::labelframe $w.lf3 -text 'Defined List Only'
hwtk::combobox $w.lf3.cb -values $beam_list -help 'BEAM SECTIONS' -textvariable beam_sect
switch -regexp -- $beam_sect {
I {
set Inertia [hm_getvalue beamsects name=I_beam dataname=results_Icentroid0]
set dim_1 [hm_getvalue beamsects name=I_beam dataname=beamsect_dim1]
set dim_2 [hm_getvalue beamsects name=I_beam dataname=beamsect_dim2]
set dim_3 [hm_getvalue beamsects name=I_beam dataname=beamsect_dim3]
set dim_4 [hm_getvalue beamsects name=I_beam dataname=beamsect_dim4]
set dim_5 [hm_getvalue beamsects name=I_beam dataname=beamsect_dim5]
set dim_6 [hm_getvalue beamsects name=I_beam dataname=beamsect_dim6]
set aera [hm_getvalue beamsects name=I_beam dataname=results_area]
set Icog [hm_getvalue beamsects name=I_beam dataname=results_centroid0]
}
C {
set Inertia [hm_getvalue beamsects name=C_beam dataname=results_Icentroid0]
set dim_1 [hm_getvalue beamsects name=C_beam dataname=beamsect_dim1]
set dim_2 [hm_getvalue beamsects name=C_beam dataname=beamsect_dim2]
set dim_3 [hm_getvalue beamsects name=C_beam dataname=beamsect_dim3]
set dim_4 [hm_getvalue beamsects name=C_beam dataname=beamsect_dim4]
set dim_5 [hm_getvalue beamsects name=C_beam dataname=beamsect_dim5]
set dim_6 [hm_getvalue beamsects name=C_beam dataname=beamsect_dim6]
set aera [hm_getvalue beamsects name=C_beam dataname=results_area]
set Icog [hm_getvalue beamsects name=C_beam dataname=results_centroid0]
}
Answers
-
Hi Seckin,
Set the -textvariable as a namespace variable, you can do the below
hwtk::labelframe $w.lf3 -text 'Defined List Only'
hwtk::combobox $w.lf3.cb -values $beam_list -help 'BEAM SECTIONS' -textvariable ::beam_sectputs '$::beam_sect'
0 -
Thanks Livil Lyle it worked /emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
0