xradiobutton action with procedure string output
Posted: Wed Aug 01, 2007 12:00 pm
Hello,
I have a peace of a code that does not work normally.
Here it is:
My problem is if I press xradiobutton "a" procedure modelmode() works fine and procAstr=procA($1), however radiobuttons "A", "B", "C" or "D" do not activate procedures procA(), procB() and so on. I have an idea that output of proc is in format that I can not use as the action to execute. But I can not find any other solution to make code simple.
I have a peace of a code that does not work normally.
Here it is:
Code: Select all
strdef procAstr, procBstr, procCstr, procDstr, modelm_one, modelm_two, modelm_three
sprint(modelm_one, "modelmode(%d)", 0)
sprint(modelm_two, "modelmode(%d)", 1)
sprint(modelm_three, "modelmode(%d)", 2)
proc procA() {
}
proc procB() {
}
proc procC() {
}
proc procD() {
}
proc modelmode() {local mmode
mmode=$1
sprint(procAstr, "procA(%d)", mmode)
sprint(procBstr, "procB(%d)", mmode)
sprint(procCstr, "procC(%d)", mmode)
sprint(procDstr, "procD(%d)", mmode)
}
xpanel("")
xlabel("")
xradiobutton("a", modelm_one)
xradiobutton("b", modelm_two)
xradiobutton("c", modelm_three)
xlabel("")
xradiobutton("A", procAstr)
xradiobutton("B", procBstr)
xradiobutton("C", procCstr)
xradiobutton("D", procDstr)
xpanel()