How to change the

3 ビュー (過去 30 日間)
Gopinath Karuppannan
Gopinath Karuppannan 2020 年 10 月 30 日
コメント済み: Stephen23 2020 年 11 月 3 日
Hi, i am creating a comment box wich could list all the comments from different functions, So for that i have taken "boxy" as global parameter. But i need to change the editbox comments color based upon "warning" (orange) and "error" (red).
When i try to alter the color for specific line, it automatically alters the color of all the lines. see attachment for better understanding.
Below script for reference purpose not the original script.
My actual need is when i alter the colorstring to "red", the the specific line alone need to change "red" not the every line.
Pushbutton1 ---> comment box
edit1 --> edit box
  2 件のコメント
Rik
Rik 2020 年 10 月 30 日
I don't see why you need a global variable.
To answer your question: I am not aware that it is possible to set the color of specific lines. You could hack it by using an axes object with text objects.
Stephen23
Stephen23 2020 年 11 月 3 日

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

採用された回答

Walter Roberson
Walter Roberson 2020 年 10 月 30 日
You are using GUIDE, which uses "traditional" figures.
In traditional figures, edit boxes and text boxes cannot have color for individual lines or individual parts of strings.
I do not know whether it is possible for edit boxes or text boxes to have color with App Designer uifigure() -- there are more formatting facilities for App Designer and I have not researched it enough to figure out all of the possibilties.
For traditional figures, uitable objects can be set to different colors for different cells, provided that the cells are text format. Scrolling these to a particular line (such as the last line) is a bit annoying to code.
For traditional figures, uicontrol style 'listbox' and uicontrol style 'popup' can be set to have different colors for different lines. Scrolling a 'popup' to a particular line is not possible (that I can think of.) Scrolling a listbox to a particular line is a bit annoying to code.
  3 件のコメント
Walter Roberson
Walter Roberson 2020 年 11 月 2 日
Not for traditional figures using uicontrol text or uicontrol edit. Those are restricted to plain text.
Unless, that is, you are willing to grab the underlying Java objects and bash on those using Java calls.
Gopinath Karuppannan
Gopinath Karuppannan 2020 年 11 月 3 日
Okay, May be i should have eliminate this because i dont know much about java objects.
Thanks for answers walter.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by