Skip to main content
16-Pearl
December 12, 2023
Solved

How to set coloured text from Data Utility?

  • December 12, 2023
  • 2 replies
  • 1536 views

Is there any method available to set the coloured text from Data Utility?

Best answer by HelesicPetr

Hi @TDT 

yes you can. 

The method is to define your own CSS style then add a style to the AbstractGuiComponent

 

for example add own CSS style with your color to a  xtheme-windchill.css

name MYCOLOR

.MYCOLOR {
color: red;
font-weight: bold;
}

and you set a style by .addStyleClass method in the DataUtility.

guiComponent.addStyleClass("MYCOLOR");

PetrH

2 replies

HelesicPetr
22-Sapphire II
22-Sapphire II
December 12, 2023

Hi @TDT 

yes you can. 

The method is to define your own CSS style then add a style to the AbstractGuiComponent

 

for example add own CSS style with your color to a  xtheme-windchill.css

name MYCOLOR

.MYCOLOR {
color: red;
font-weight: bold;
}

and you set a style by .addStyleClass method in the DataUtility.

guiComponent.addStyleClass("MYCOLOR");

PetrH

14-Alexandrite
December 12, 2023

This article has a similar use-case, refer - https://www.ptc.com/en/support/article/CS354557