×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Dynamically update a GUI

Dynamically update a GUI

Dynamically update a GUI

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources