I have a question to ask the MATLAB gurus here ..
So here is my code (only showing lines of code which are relevant to the problem here):
mainProcess(hObject, handles)
handles.Checkpoint2 =1;
guidata(hObject, handles);
function testGUI1_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
handles.Checkpoint1 = 1;
mainProcess(hObject, handles);
handles.Checkpoint3 = 1; //EDIT: Checkpoint2 is also not visible at this line
guidata(hObject, handles);
handles.Checkpoint4 = 1;
function saveAndContinueButton_Callback(hObject, eventdata, handles)
(breakpoint here) --> faceDatabase(handles.currentImageIteration).lookingTowardsCamera=handles.lookingAtCamera;
So in the above code, I'm making these 'checkpoints' at different parts of the code, and seeing which of them are visible when a save and continue button is clicked separately ... Checkpoint1 is created BEFORE calling my custom function called mainProcess, Checkpoint2 is created within the code of mainProcess, and Checkpoint3 is created AFTER mainProcess is finished executing and the control is back with the function that called it, which is testGUI1_OpeningFcn ... And Checkpoint4 is created WITHIN testGUI1_OpeningFcn, but AFTER the handles structure is updated in the testGUI1_OpeningFcn code ..
So my question is this, when the button is clicked and I see what is visible at that point, Checkpoint 1 and 3 are visible to the button Callback code, but Checkpoints 2 and 4 are NOT visible ... I understand that Checkpoint4 is not visible because it was created AFTER the handles structure was updated in testGUI1_OpeningFcn's code ... But why is Checkpoint2 not visible, even when at the end of mainProcess's code, I did put a line:
guidata(hObject, handles);
I mean the mainProcess function is getting references to both hObject and handles, so it should have write access to it, right ?
So why isn't Checkpoint2 not visible to the button's Callback code .. ?
Any clues ?
EDIT: I just tried to see if Checkpoint2 is visible even within mainProcess's calling function, right after the control is returned the caller, and even there Checkpoint2 is not visible (see the EDIT in the code above) ..