input prompt do not work in callback function

7 ビュー (過去 30 日間)
shahar hirshfeld
shahar hirshfeld 2018 年 2 月 5 日
コメント済み: Michael Sanchez 2018 年 9 月 5 日
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 件のコメント
shahar hirshfeld
shahar hirshfeld 2018 年 2 月 6 日
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 日
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 件のコメント
Michael Sanchez
Michael Sanchez 2018 年 9 月 5 日
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 件)

カテゴリ

Help Center および File ExchangeApp Building についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by