Why does "msgbox" add extra space?

I have a subroutine that reports avg and std values for up to 12 regions of interest in a single "msgbox" dialog. What I've noticed is that for multiple lines of text input to "msgbox", the figure adds extra space above the text area, which makes it look pretty ridiculous:
Any idea why the heck it does that?

1 件のコメント

Arthur
Arthur 2013 年 9 月 19 日
Can you show use the code?

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

回答 (1 件)

Jan
Jan 2013 年 9 月 20 日

1 投票

While it does not answer your question, I want to mention that a msgbox might be a bad choice to display this text. You can create a more appropriate dialog using a listbox with scrolling.

5 件のコメント

Ana
Ana 2014 年 3 月 21 日
Is there actually any answer to the question? I am experiencing the same problem. "listbox" doesn't appear as a Matlab command...I have tried using listdlg, and it kind of solves the problem (I can remove the "Select all" option but I would also like Cancel not to be an option, that is why in the beginning I was using msgbox). Any help will be appreciated.
Ana
nl2605
nl2605 2014 年 3 月 21 日
He means a listbox in guide.
Ana
Ana 2014 年 3 月 21 日
Oh, ok..! But for this you should create a .fig in guide and call a different gui from your gui, right? Isn't there a more straightforward way?
Jan
Jan 2014 年 3 月 21 日
I avoid working with GUIDE. You can create the required code manually also:
FigH = figure('Menubar', 'none');
ListBoxH = uicontrol(FigH, 'Style', 'listbox', ...
'Units', 'Normalized', 'Position', [0,0,1,1], ...
'String', {'Yout text', 'E.g. split by TEXTWRAP()'})
Ana
Ana 2014 年 3 月 24 日
Ok..! Thanks!

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

カテゴリ

ヘルプ センター および File ExchangeDesktop についてさらに検索

タグ

質問済み:

2013 年 9 月 19 日

コメント済み:

Ana
2014 年 3 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by