Prev: Accessing matrices
Next: Shifting to Win7 with My Student Edition for Release 14. ProgramDisappears!
From: Mathew Thomas on 7 Feb 2010 00:04 Hey All !!! How do I make a checkbox update ? ie, my first click works fine (for example, if the value when the box is checked is to be given as 2, it works well), but if I uncheck the box, nothing happens (I want the value to go to zero when the box is unchecked again). I am doing it in guide. Any suggestions?? Thanks in advance, Mathew
From: ImageAnalyst on 7 Feb 2010 00:15 Mathew You don't need to do anything to make it update. When you check or uncheck it, it's updated immediately. You can check it's value just by doing: checkboxValue = get(handles.checkbox1, 'value'); It's value will be either 1 for checked and 0 for unchecked. How are you being given a value of 2 from it??? As far as I know it only returns 0 or 1.
From: Mathew Thomas on 7 Feb 2010 00:53 Hey, This is what I have: function DRUM2_Callback(hObject, eventdata, handles) global data1_deciduous_maxilla user_input_for_missing_teeth = (get(hObject,'Value')); if user_input_for_missing_teeth == 1 %ie, if user clicks in the check box data1_deciduous_maxilla = 2; end if user_input_for_missing_teeth == 0 %Not Working....Value is still 2, even after data1_deciduous_maxilla = []; % clicking checkbox off end Thanks
From: Mathew Thomas on 7 Feb 2010 01:26
Hey ImageAnalyst, Got it!!! Had a typo in the code....Thanks though.. Mathew |