Issues to hide a text edit box in a radio boxHi,
I am trying to use a radio box that should hide/show a text edit box, but it does not work (see code attached).
Basically Choice 1 should show the text edit box, and Choice 2 should hide it.
I see at least 2 abnormal behavior:
1. if I clic several times on Choice 2, the text edit box is hiden, then shown, then hiden, then shown,... Although, it should stay hidden
2. Clicking on CHoice 1 does not always show the text edit box: it depends on the state of the text edit box before clicking...
I guess i am missing something fundamental 
MyWindow = New Window( "Test...",
Panel Box( "Info",
rb = Radio Box(
{"Choice 1", "Choice 2"},
<<SET function=""></SET>Re: Issues to hide a text edit box in a radio boxNot sure why your code wasn't working. Maybe because you didn't supply an argument to hide? In any event you can include the code inside MyWindow thusly:
NamesDefaultToHere(1);
MyWindow =
New Window( "Test...",
Panel Box( "Info",
rb = Radio Box({"Choice 1", "Choice 2"},
choice = rb << getSelected;
if (choice == "Choice 1", teb << hide(0),
choice == "Choice 2", teb << hide(1)
);
),
teb = text edit box("Some text to edit")
)
);
Re: Issues to hide a text edit box in a radio boxHi Jan,
Great it works !!!!
I m trying to understand...Is my code not working because I try to execute hide and show inside MyWindow ??
Re: Issues to hide a text edit box in a radio boxHere's one way:
NamesDefaultToHere(1);
MyWindow =
New Window( "Test...",
Panel Box( "Info",
rb = Radio Box({"Choice 1", "Choice 2"}),
teb = text edit box("Some text to edit")
)
);
rb << setScript(
choice = rb << getSelected;
if(
choice == "Choice 1", teb << hide(0),
choice == "Choice 2", teb << hide(1)
)
);