i can work around this problem, however because of my OCD i have to ask. the input function do not prompt what it is in a function that is called from UI callback.
function test
f = figure;
f.ButtonDownFcn = @func;
end
function func(~,~,~)
disp('button was down')
b = input('input prompt here :', 's');
disp(['the input was: ' b])
end
the output is:
>> test
button was down
this is my data
the input was: this is my data
>>
is it a bug or i missed something?

댓글 수: 6

Birdman
Birdman 2018년 2월 5일
What are you trying to do here? It is not clear.
Stephen23
Stephen23 2018년 2월 5일
편집: Stephen23 2018년 2월 5일
@Birdman: the point is that the prompt is not displayed, as one might expect it to be. Check the output.
Guillaume
Guillaume 2018년 2월 5일
편집: Guillaume 2018년 2월 5일
There may be a bug or not (haven't checked) but in my opinion forcing the user to switch from a GUI to the command prompt is very poor UI design. Even if it worked properly, as a user I would not even look at the command prompt after clicking on the GUI and thus would be left wondering why nothing was happening having no clue that the command prompt is waiting for my input.
Use inputdlg if you must and even better put the input fields directly in your GUI.
I agree. However it is not my code and it have multiple files.I tray not to work to hard to fix it.
My solution is overloading the function.
BTW,"poor UI" is realy dependent on the aplication. You cannot setup rules that will work all the time. When using dlg input it hard to see a full log. Also when docking the gui near the command the transition is very intuitive.
Guillaume
Guillaume 2018년 2월 6일
Well, yes of course, it depends on the application. I would argue though that if your GUI needs inputs from the user, then these inputs should be part of the GUI in the first place. Even inputdlg is problematic, modal dialogs may be simple but they're not flexible as you say.
When designing UI you have to bear in mind that the user may not work the same way you do. For example, if presented with a docked figure, the first thing I'll do is undock it and move it to a different screen and possibly minimise matlab's main window. Hence I probably wouldn't notice your input prompt.

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan
Jan 2018년 2월 6일

2 개 추천

This is a bug. Your code should show the prompt string in the command window.
Please send a bug report to MathWorks. Use the "Contact Us" button.

댓글 수: 1

I have also experienced the same bug in R2018a. Reverting to R2017a/b returns expected behavior. Since it was noted months ago, will there be a fix anytime soon?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

제품

태그

질문:

2018년 2월 5일

댓글:

2018년 9월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by