how write in edit text and send result to another edit text without pushbutton? PLEASE
2 次查看(过去 30 天)
显示 更早的评论
I have a very simple gui program and I would like to add as a luxury that when in edittext enter the function in the other output edittext, automatically write the function already integrated. (my program integrates but, I want you to integrate without using a pushbutton) Can you?
0 个评论
采纳的回答
Walter Roberson
2017-11-4
You can set a Callback function on the uicontrol('style','edit'). It will be called when the user presses return in the edit box or clicks outside the box.
2 个评论
Walter Roberson
2017-11-4
编辑:Walter Roberson
2017-11-4
function edittext2_Callback(hObject, event, handles)
formula = strtrim( get(hObject, 'String') );
if isempty(formula); return; end
form_expr = sym(formula);
form_int = int(form_expr);
form_int_char = char(form_int);
set(handles.text3, 'String', form_int_char); %send it to output location
And ensure that edittext2_Callback has been set as the Callback for edittext2
This is a callback for a uicontrol style 'edit'. It will be activated when the user presses Return after entering a new formula.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Data Preparation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!