Borrar filtros
Borrar filtros

textbox in a GUI

32 visualizaciones (últimos 30 días)
Shree Nath
Shree Nath el 8 de Jun. de 2012
i wanted to create a gui using matlab, which is supposed to look lyk the pic above.. wanted to know, is it possible to have the desire text in a text box? secondly, will it be possible for me to get them scrolled down too ??
i learned about textboxes and annotations too..but i dont think they'll work here.
can it all be possible with matlab gui or i'll have to switch over to another language?

Respuesta aceptada

Walter Roberson
Walter Roberson el 8 de Jun. de 2012
Usually "textbox" refers to uicontrol('style','text') . Putting a uicontrol in the middle of a graph is possible but not nice to work with.
text() can place text anywhere on an axes, including on a drawing of a "word ballon".
text() works in data coordinates, and is compatible with scrolling.
  6 comentarios
Shree Nath
Shree Nath el 9 de Jul. de 2012
okay sir, seems i should give up havin an image in the background with a text.
~~actually, i am reading text files from a folder, and then displaying them, as you may see what our 'mobile chatbox is like'- the received and sent messages in a diffrent color, and all of'em arranged chronologically.~~
the new problem is, can i fix the width of a text box, whereas its height may vary according to the text contained inside?
Walter Roberson
Walter Roberson el 9 de Jul. de 2012
See textwrap to do part of the work, to get the text to the right width. set() the control to that wrapped text. Then get() the Extent property of the control, and look at the height portion of the resulting vector (the third element): that will tell you how high the text box would have to be in order to fit the entire text. So then you can set() the box to be that high.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by