next up previous contents
Next: Drop-down Menus Up: Commonly Used Code Previous: Radio Buttons   Contents

Check Boxes

A naive yet useful implementation of those will involve an element state which hold some information about the state of the checkbox or its meaning.

if (get(handles.state,'Value') == 0),

   set(handles.checkbox, 'Value', 0);

   set(handles.state, 'String', '0');

else

   set(handles.checkbox, 'Value', 1);

   set(handles.state, 'String', '1'); 

end



2004-05-19