can i have a box with 3 buttons?

14 ビュー (過去 30 日間)
raghavendra kandukuri
raghavendra kandukuri 2019 年 10 月 1 日
編集済み: raghavendra kandukuri 2019 年 10 月 2 日
Hi,
Is there a way to add additional button to Inputdlg?, i know it comes with ok and cancel, i was looking to add one more to it.
for example:
prompt = {'Enter matrix size:','Enter colormap name:'};
dlg_title = 'Input';
num_lines = 1;
defaultans = {'20','hsv'};
answer = inputdlg(prompt,dlg_title,num_lines,defaultans);
so i was looking to add one more button called 'Apply all'.
Is it possible? is there any other pre defined function where i can have 2 text fileds and 3 buttons?
  2 件のコメント
Adam Danz
Adam Danz 2019 年 10 月 1 日
How would "apply all" behave differently than "ok"?
raghavendra kandukuri
raghavendra kandukuri 2019 年 10 月 1 日
Hello Adam,
I have a piece of code which is exactly like the above syntax, apart from the wordings.
so this particular code is in a loop, where in this box appears every single time the control visits the loop.
so i was looking for something like "apply all" button on it, so when i hit that button, my expected funtionality is, it doesnt pop up every single time it visits the loop, just one single time at the begining would be sufficient.

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2019 年 10 月 1 日
編集済み: Adam Danz 2019 年 10 月 2 日
"Is there a way to add additional button to Inputdlg?"
No.
One alternative is to build your own input dlg using uicontrol() but a quicker solution would be to add 1 more input to your inputdlg that merely asks if the user would like to "apply all" by entering yes/no or 1/0.
191002 093834-Input.png
prompt = {'Enter matrix size:','Enter colormap name:','Apply all (1/0)?'};
dlg_title = 'Input';
num_lines = 1;
defaultans = {'20','hsv','0'};
answer = inputdlg(prompt,dlg_title,num_lines,defaultans);

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by