I've created a radio button which gets prompted when posting a program in Unigraphics.
How can I modify this so that the radio button remembers it's previous settings from a previous prompting?
I hope this makes sense.
Thanks,
Paul Perry
The below code is for my radio button:
wm title . " HAAS MASTER POST "
############################################################
proc bldORpattern { parent varname args } {
set i [frame $parent.cst_pat -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $i.$b -variable $varname \
-text $item -value $item
pack $i.$b -side left
incr b
}
pack $i -side top -pady 7 -anchor w -fill x
}
############################################################
proc Probing { parent varname args } {
set j [frame $parent.probing -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $j.$b -variable $varname \
-text $item -value $item
pack $j.$b -side left
incr b
}
pack $j -side top -pady 7 -anchor w -fill x
}
############################################################
proc Fixtures { parent varname args } {
set f [frame $parent.choices -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $f.$b -variable $varname \
-text $item -value $item
pack $f.$b -side left
incr b
}
pack $f -side top -pady 7 -anchor w -fill x
}
############################################################
proc ShowChoices { parent varname args } {
set g [frame $parent.side -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $g.$b -variable $varname \
-text $item -value $item
pack $g.$b -side left
incr b
}
pack $g -side top -pady 7 -anchor w -fill x
}
############################################################
proc ShowHand { parent varname args } {
set h [frame $parent.hand -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $h.$b -variable $varname \
-text $item -value $item
pack $h.$b -side left
incr b
}
pack $h -side top -pady 7 -anchor w -fill x
}
############################################################
set cst_pat "Machining_Propellers"
bldORpattern {} cst_pat "Machining_Propellers" "Machining_Patterns"
set probing "Probe_Propellers "
Probing {} probing "Probe_Propellers " "Probe_Patterns"
set choice "18-28_Fixture "
Fixtures {} choice "18-28_Fixture " "29-36_Fixture " "5Blade_Fixture"
set side "Pressure_Side "
ShowChoices {} side "Pressure_Side " "Suction_Side"
set hand "Right_Hand "
ShowHand {} hand "Right_Hand " "Left_Hand"
############################################################
pack [ button .b2 -text Done -padx 25 -pady 5 -command Writoe ] -side bottom -padx 20 -pady 10
###########################################################
proc Writoe {} {
global cst_pat
global probing
global choice
global side
global hand
puts $cst_pat
puts $probing
puts $choice
puts $side
puts $hand
set l_return [list $cst_pat $probing $choice $side $hand]
puts $l_return
exit
}
How can I modify this so that the radio button remembers it's previous settings from a previous prompting?
I hope this makes sense.
Thanks,
Paul Perry
The below code is for my radio button:
wm title . " HAAS MASTER POST "
############################################################
proc bldORpattern { parent varname args } {
set i [frame $parent.cst_pat -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $i.$b -variable $varname \
-text $item -value $item
pack $i.$b -side left
incr b
}
pack $i -side top -pady 7 -anchor w -fill x
}
############################################################
proc Probing { parent varname args } {
set j [frame $parent.probing -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $j.$b -variable $varname \
-text $item -value $item
pack $j.$b -side left
incr b
}
pack $j -side top -pady 7 -anchor w -fill x
}
############################################################
proc Fixtures { parent varname args } {
set f [frame $parent.choices -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $f.$b -variable $varname \
-text $item -value $item
pack $f.$b -side left
incr b
}
pack $f -side top -pady 7 -anchor w -fill x
}
############################################################
proc ShowChoices { parent varname args } {
set g [frame $parent.side -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $g.$b -variable $varname \
-text $item -value $item
pack $g.$b -side left
incr b
}
pack $g -side top -pady 7 -anchor w -fill x
}
############################################################
proc ShowHand { parent varname args } {
set h [frame $parent.hand -borderwidth 2 ]
set b 0
foreach item $args {
radiobutton $h.$b -variable $varname \
-text $item -value $item
pack $h.$b -side left
incr b
}
pack $h -side top -pady 7 -anchor w -fill x
}
############################################################
set cst_pat "Machining_Propellers"
bldORpattern {} cst_pat "Machining_Propellers" "Machining_Patterns"
set probing "Probe_Propellers "
Probing {} probing "Probe_Propellers " "Probe_Patterns"
set choice "18-28_Fixture "
Fixtures {} choice "18-28_Fixture " "29-36_Fixture " "5Blade_Fixture"
set side "Pressure_Side "
ShowChoices {} side "Pressure_Side " "Suction_Side"
set hand "Right_Hand "
ShowHand {} hand "Right_Hand " "Left_Hand"
############################################################
pack [ button .b2 -text Done -padx 25 -pady 5 -command Writoe ] -side bottom -padx 20 -pady 10
###########################################################
proc Writoe {} {
global cst_pat
global probing
global choice
global side
global hand
puts $cst_pat
puts $probing
puts $choice
puts $side
puts $hand
set l_return [list $cst_pat $probing $choice $side $hand]
puts $l_return
exit
}