How can I avoid ellipsis in checkbox GUI?

1 view (last 30 days)
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 Comment
Rik
Rik on 20 May 2018
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.

Sign in to comment.

Accepted Answer

Jan
Jan on 20 May 2018
Edited: Jan on 20 May 2018
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.

More Answers (2)

Image Analyst
Image Analyst on 20 May 2018
Edited: Image Analyst on 20 May 2018
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 Comments
Walter Roberson
Walter Roberson on 20 May 2018
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.

Sign in to comment.


Walter Roberson
Walter Roberson on 20 May 2018
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.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!