How can I avoid ellipsis in checkbox GUI?

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 comentario

Rik
Rik el 20 de Mayo de 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.

Iniciar sesión para comentar.

 Respuesta aceptada

Jan
Jan el 20 de Mayo de 2018
Editada: Jan el 20 de Mayo de 2018

0 votos

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.

Más respuestas (2)

Image Analyst
Image Analyst el 20 de Mayo de 2018
Editada: Image Analyst el 20 de Mayo de 2018

0 votos

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 comentarios

Marc Bingo
Marc Bingo el 20 de Mayo de 2018
I am using guide. I tried to used sprintf but it didn't work.
Thank you.
Walter Roberson
Walter Roberson el 20 de Mayo de 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.

Iniciar sesión para comentar.

Walter Roberson
Walter Roberson el 20 de Mayo de 2018

0 votos

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.

Categorías

Más información sobre Entering Commands en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de Mayo de 2018

Respondida:

el 20 de Mayo de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by