Dear all,
I try to set the following text in checkbox in a GUI: "If the value is under 1, then the process is adiabatic. Pressure will increase due to conservation of energy"
But text is too long so it displays:
If the value is under 1, then...
I would like to avoid such ellipsis (three points: ...) and show the rest of the text in a second or several lines instead of a single line with ellipsis at the end.
If the value is under 1, then the
process is adiabatic. Pressure
will increase due to conservation
of energy
How could I do it?
Thank you.
Marc

댓글 수: 1

Rik
Rik 2018년 5월 20일
Not a real answer, but you might hack this by using no text for the checkbox string property and create the text with the uicontrol text option.

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

 채택된 답변

Jan
Jan 2018년 5월 20일
편집: Jan 2018년 5월 20일

0 개 추천

Checkboxes do not accept multi-line text. But you can create a checkbox without a string, and set a multi-line text right beside it. Then you have full control over the appearance of the text.

추가 답변 (2개)

Image Analyst
Image Analyst 2018년 5월 20일
편집: Image Analyst 2018년 5월 20일

0 개 추천

Are you using GUIDE or App Designer? You need to set the Max property to 2 I believe. Or create the text label with sprintf() to make the string in your code and use \n if you want it on a new line. Or just have all that be in the TooptipString and not the label itself.

댓글 수: 2

Marc Bingo
Marc Bingo 2018년 5월 20일
I am using guide. I tried to used sprintf but it didn't work.
Thank you.
Walter Roberson
Walter Roberson 2018년 5월 20일
This is not correct. Max makes a difference in output lines for uicontrol style text or style edit, but for uicontrol style checkbox, Max controls the Value that the uicontrol will have when the check box is active.

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

Walter Roberson
Walter Roberson 2018년 5월 20일

0 개 추천

If you must use a checkbox for this purpose then you have two options:
  1. instead of setting the String property with the desired text, create a image array containing the desired text rendered as an image, and set the CData property of the uicontrol style checkbox; or
  2. look over on http://undocumentedmatlab.com for information on how to use the java objects that underlie uicontrols.

카테고리

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

질문:

2018년 5월 20일

답변:

2018년 5월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by