From: pedro moreno on
Well, actually I don't understand very well the responses... but I still hope that some can give me a solution/idea for my problem... because http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples is a web with advanced code, and my software is easier...

My code (the wrong solution that I had through), from GUI_1:
GUI_1:

function pushbutton_Callback(hObject, eventdata, handles)
gui2; %it returns GUI_2
load('acept_cancel.mat');
if b_Acept
set(handles.pushbutton2,'BackgroundColor',[0 1 0]); %green colour
%else, it keeps the default grey colour
end

GUI_2:

function pushbutton1_Callback(hObject, eventdata, handles)
%Button ACEPT
b_Acept= true;
save('acept_cancel.mat',b_Acept);
close;

function pushbutton2_Callback(hObject, eventdata, handles)
%Button CANCEL
b_Acept= false;
save('acept_cancel.mat',b_Acept);
close;

It doesn't work because firstly the file acept_cancel.mat doesnt exist, my idea is that it was created only in the execution, and it dissapeared at the end. ¿Any idea? thx in advance, and sorry for my voluptuous prose again ;)
From: Walter Roberson on
pedro moreno wrote:
> Well, actually I don't understand very well the responses... but I still
> hope that some can give me a solution/idea for my problem... because
> http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
> is a web with advanced code, and my software is easier...
>
> My code (the wrong solution that I had through), from GUI_1:
> GUI_1:
>
> function pushbutton_Callback(hObject, eventdata, handles)
> gui2; %it returns GUI_2
> load('acept_cancel.mat');
> if b_Acept
> set(handles.pushbutton2,'BackgroundColor',[0 1 0]); %green colour


So why not just

get(handles.pushbutton2, 'BackgroundColor')
and test to see if the result is [0 1 0] or not ?