cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
BabyDoragon
Level II

How to set a red background or red text on different lines within the List box?

If using

ListboxTemp<< background color("red");

, only the entire List box can change color.

May I ask if it is possible to set a red background or red text on different lines within the List box?
As shown in the picture below.

Different Colored backgroundDifferent Colored backgroundDifferent Colored textDifferent Colored text

5 REPLIES 5
jthi
Super User

Re: How to set a red background or red text on different lines within the List box?

I don't think you can manipulate single items in listbox outside of icons

jthi_0-1755680261722.png

 

-Jarmo
BabyDoragon
Level II

Re: How to set a red background or red text on different lines within the List box?

How should I add an icon?

jthi
Super User

Re: How to set a red background or red text on different lines within the List box?

Scripting Index has an example

jthi_0-1755680754832.png

Names Default To Here(1);
New Window("Example",
	fontobj = lb = List Box(
		{{"First Item", "continuous"}, {"Second Item", "ordinal"},
		{"Third Item", "nominal"}},
		width(200),
		max selected(2),
		nlines(6)
	)
);

As does Scripting Guide Scripting Guide > Display Trees > Construct Custom Windows > Construct Display Boxes for New Windows 

jthi_1-1755680877388.png

 

 

-Jarmo
BabyDoragon
Level II

Re: How to set a red background or red text on different lines within the List box?

I thought it was enough to just provide the index to mark the icon, for example, marking the icon on the 1st and 3rd lines only.
I didn't expect that each item in the list would need an additional set of parentheses to mark the icon.
This way of marking is not very intuitive programmatically.

jthi
Super User

Re: How to set a red background or red text on different lines within the List box?

You are dealing with scripting language, it isn't always very intuitive. You can make wish list items and hope for possible improvements down the line. 

 

To my knowledge you cannot update item in List Box. You can only add and remove items. You could create your own helper function to utilize those capabilities to add icons to specific indices. 

-Jarmo

Recommended Articles