GUI: Update listbox while editing text
Show older comments
I want a listbox to be dynamically updated when I change the input in an edit text box. The standard behavior of the GUI is to execute the callback function for the edit text box only after pressing enter or clicking outside the text box, but I want to find a way to execute the function while typing... this should not be so difficult right?
this is what I tried after searching the web:
function edit_text(hObject, eventdata, handles)
addlistener(handles.edit_text,'String',@(hObject,eventdata)updateList(hObject,eventdata,handles));
and then I added the updateList function at the end of the GUI
function updateList(hObject,eventdata,handles)
% code to set listboxInput
set(handles.listbox_invoer,'String',listboxInput);
% Update handles structure
guidata(hObject, handles);
but I get the following error "The specified event is not supported by the object" referring to the line where I try to add the addlistener
Can someone help me on how to use this addlistener, the help documentation is not very explanatory...
Answers (0)
Categories
Find more on Desktop in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!