cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
This widget could not be displayed.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
BabyDoragon
Level II

How to restore the color of a ListBox to its default?

In the following JSL, after changing the color of the ListBox frame, how can I revert it to the default color?

Also, if I want to change the background color of the ListBox, how should I set it up? The command for changing the background color modifies the color of the frame.

Names Default To Here( 1 );
New Window( "Example",
	b = List Box( {"single", "double", "triple"}, nlines( 5 ) )
);
wait(2);
b<< background color("red");
wait(2);
//b<< background color("default color?");

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to restore the color of a ListBox to its default?

To reset it set it to "None" and I'm not sure about changing the background.

 

Edit:

And when you are trying to figure out stuff like this, you can attempt to get the "default" value before changing it. In this you can use << Get Background Color

Names Default To Here(1);

nw = New Window("Example", 
	lb = List Box({"single", "double", "triple"}, nlines(5))
);
def_color = lb << Get Background Color();
show(def_color);

Wait(1);
lb << background color("red");

Wait(1);
lb << background color("None"); // after you have checked what it is 

// Or sometimes you might want to use
lb << background color(def_color);
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How to restore the color of a ListBox to its default?

To reset it set it to "None" and I'm not sure about changing the background.

 

Edit:

And when you are trying to figure out stuff like this, you can attempt to get the "default" value before changing it. In this you can use << Get Background Color

Names Default To Here(1);

nw = New Window("Example", 
	lb = List Box({"single", "double", "triple"}, nlines(5))
);
def_color = lb << Get Background Color();
show(def_color);

Wait(1);
lb << background color("red");

Wait(1);
lb << background color("None"); // after you have checked what it is 

// Or sometimes you might want to use
lb << background color(def_color);
-Jarmo

Recommended Articles