Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically update a GUI

Status
Not open for further replies.

deltamatrix

Computer
Feb 24, 2006
1
Hi guys.

I have created a new GUI that reading input variables and passes them to a function that processes and manipulates a video and displays the results in an axes object.

The problem is that the GUI won't instantly update when I click the Process button.
I want the Process Button to disable during execution and enable again after execution but the button does not do it until its too late.

My code is as follows:

function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Doesn't work
set(handles.pushbutton1, 'Enable', 'off');

thresh_val = floor(eval(get(handles.edit3,'string')));
blocksize_val = floor(eval(get(handles.edit4,'string')));
frame_val = floor(eval(get(handles.edit5,'string')));

proc = imread('Processing.JPG');
image(proc);
set(handles.axes1);
disp('Processing....');
if thresh_val > 0 && blocksize_val > 0 && frame_val > 0,


[a, noOfObjects] = QMUL_Denoise(thresh_val,
blocksize_val, frame_val);

set(handles.edit6, 'String', int2str(noOfObjects));

movie(a);
set(handles.axes1);

end;

set(handles.pushbutton1, 'Enable', 'on');

Any help will be appreciated.

Thankyou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor