cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
%3CLINGO-SUB%20id%3D%22lingo-sub-709697%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBold%20specific%20items%20in%20a%20list%20box%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709697%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20higlight%20in%20bold%20specific%20values%20in%20a%20list%20box.%20Is%20it%20possible%20%3F%3C%2FP%3E%3CP%3EFor%20instance%20in%20the%20example%20below%2C%20I%20would%20like%20to%20put%20in%20bold%20only%20%22Second%20Item%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENew%20Window(%20%22Example%22%2C%0A%20fontobj%20%3D%20lb%20%3D%20List%20Box(%0A%20%20%7B%22First%20Item%22%2C%20%22Second%20Item%22%2C%20%22Third%20Item%22%7D%2C%0A%20%20width(%20200%20)%2C%0A%20%20max%20selected(%202%20)%2C%0A%20%20nlines(%206%20)%0A%20)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-709697%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EAutomation%20and%20Scripting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-709708%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Bold%20specific%20items%20in%20a%20list%20box%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709708%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EI%20think%20with%20list%20boxes%20you%20can%20only%20set%20which%20is%20selected%20or%20style%20for%20all%20the%20items.%20Is%20there%20a%20specific%20reason%20why%20you%20would%20like%20to%20bold%20single%20option%3F%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Anw%20%3D%20New%20Window(%22Example%22%2C%0A%20lb%20%3D%20List%20Box(%0A%20%20%7B%22First%20Item%22%2C%20%22Second%20Item%22%2C%20%22Third%20Item%22%7D%2C%0A%20%20width(200)%2C%0A%20%20max%20selected(2)%2C%0A%20%20nlines(6)%0A%20)%0A)%3B%0A%0Alb%20%26lt%3B%26lt%3B%20Set%20Selected(2)%3B%0Alb%20%26lt%3B%26lt%3B%20Set%20Font%20Style(%22Italic%20Bold%20Underline%22)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-709803%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Bold%20specific%20items%20in%20a%20list%20box%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709803%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EThere%20are%20many%20reasons%20I%20can%20think%20of%20why%20bolding%20%2F%20formatting%20specific%20entries%20in%20a%20list%20box%20could%20be%20useful!%26nbsp%3B%20I%20have%20an%20app%20where%20I%20allow%20for%20quick%20browsing%20of%20my%20API%20features%20in%20a%20way%20very%20similar%20to%20the%20JMP%20Scripting%20Index.%26nbsp%3B%20In%20order%20to%20allow%20for%20the%20formatting%20that%20helps%20with%20visual%20parsing%20I've%20had%20to%20re-create%20list%20boxes%20using%20Table%20Box%20and%20COL%20Box%2C%20wrapped%20inside%20of%20a%20mouse-box%20to%20be%20able%20to%20know%20which%20item%20is%20being%20clicked%20on%20and%20perform%20certain%20actions%20based%20on%20that%20(like%20disallowing%20certain%20entries%20from%20being%20selected).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20was%20a%20lot%20of%20work%2C%20but%20now%20it%20is%20simply%20a%20widget%20that%20I%20can%20embed%20in%20any%20script%20with%20one%20line%20of%20code%2C%20just%20like%20the%20built-in%20list%20box.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20two%20list%20boxes%20in%20this%20script%20are%20indeed%20TableBoxes%20wrapped%20within%20a%20mouse%20box%2C%20but%20the%20added%20ability%20for%20individual%20entry%20formatting%20is%20undeniable.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22ErraticAttack_1-1702673667909.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F59739i11770BDAABC2EE3F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ErraticAttack_1-1702673667909.png%22%20alt%3D%22ErraticAttack_1-1702673667909.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46646%22%20target%3D%22_blank%22%3E%40SophieCuvillier%3C%2FA%3E%26nbsp%3B%2C%20the%20short%20answer%20is%20no%20--%20JMP%20does%20not%20provide%20any%20capabilities%20for%20us%20lowly%20scripters%20to%20modify%20the%20individual%20entries%20in%20a%20list%20box.%26nbsp%3B%20They%20do%20have%20that%20capability%2C%20as%20the%20JMP%20Scripting%20Index%20does%20it%20with%20the%20list%20boxes%20they%20use.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you're%20endeavorous%20you%20can%20make%20TableBoxes%20behave%20like%20a%20list%20box%2C%20but%20it%20does%20require%20a%20bit%20of%20work.%26nbsp%3B%20I%20cannot%20give%20out%20my%20code%20for%20it%20per%20my%20companies%20regulations%2C%20but%20I'd%20be%20willing%20to%20help%20answer%20any%20questions%20if%20needed.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-709905%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Bold%20specific%20items%20in%20a%20list%20box%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-709905%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Ewow!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-710061%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Bold%20specific%20items%20in%20a%20list%20box%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-710061%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20very%20much%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F14366%22%20target%3D%22_blank%22%3E%40jthi%3C%2FA%3E%26nbsp%3Band%20you%20for%20the%20answer.%26nbsp%3BI%20need%20to%20highlight%20certain%20values%20in%20bold%20because%20they%20have%20a%20different%20utility%20for%20users%20than%20other%20values%20and%20they%20want%20to%20be%20able%20to%20differentiate%20them%20visually%20just%20by%20the%20name%20displayed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F26363%22%20target%3D%22_blank%22%3E%40ErraticAttack%3C%2FA%3E%26nbsp%3B%26nbsp%3BYour%20answer%20helped%20me%20a%20lot%2C%20thank%20you.%20I'm%20going%20to%20make%20a%20box%20table%20that%20mimics%20the%20behavior%20of%20a%20box%20list%20and%20bold%20the%20values%20I%20want%20in%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-710142%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Bold%20specific%20items%20in%20a%20list%20box%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-710142%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EWhat%20if%20you%20split%20the%20list%20into%20two%20lists%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-712087%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Bold%20specific%20items%20in%20a%20list%20box%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-712087%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EI%20need%20to%20have%20all%20the%20values%20(bold%20and%20not%20bold)%20in%20the%20same%20place%2C%20it%20must%20be%20sorted%20by%20alphabetical%20order%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

Bold specific items in a list box

Hello,

 

I would like to higlight in bold specific values in a list box. Is it possible ?

For instance in the example below, I would like to put in bold only "Second Item"

 

New Window( "Example",
	fontobj = lb = List Box(
		{"First Item", "Second Item", "Third Item"},
		width( 200 ),
		max selected( 2 ),
		nlines( 6 )
	)
);
1 ACCEPTED SOLUTION

Accepted Solutions
ErraticAttack
Level VI

Re: Bold specific items in a list box

There are many reasons I can think of why bolding / formatting specific entries in a list box could be useful!  I have an app where I allow for quick browsing of my API features in a way very similar to the JMP Scripting Index.  In order to allow for the formatting that helps with visual parsing I've had to re-create list boxes using Table Box and COL Box, wrapped inside of a mouse-box to be able to know which item is being clicked on and perform certain actions based on that (like disallowing certain entries from being selected).

 

It was a lot of work, but now it is simply a widget that I can embed in any script with one line of code, just like the built-in list box.

 

The two list boxes in this script are indeed TableBoxes wrapped within a mouse box, but the added ability for individual entry formatting is undeniable. 

ErraticAttack_1-1702673667909.png

 

@SophieCuvillier , the short answer is no -- JMP does not provide any capabilities for us lowly scripters to modify the individual entries in a list box.  They do have that capability, as the JMP Scripting Index does it with the list boxes they use.

 

If you're endeavorous you can make TableBoxes behave like a list box, but it does require a bit of work.  I cannot give out my code for it per my companies regulations, but I'd be willing to help answer any questions if needed.

Jordan

View solution in original post

6 REPLIES 6
jthi
Super User

Re: Bold specific items in a list box

I think with list boxes you can only set which is selected or style for all the items. Is there a specific reason why you would like to bold single option?

Names Default To Here(1);

nw = New Window("Example",
	lb = List Box(
		{"First Item", "Second Item", "Third Item"},
		width(200),
		max selected(2),
		nlines(6)
	)
);

lb << Set Selected(2);
lb << Set Font Style("Italic Bold Underline");
-Jarmo
ErraticAttack
Level VI

Re: Bold specific items in a list box

There are many reasons I can think of why bolding / formatting specific entries in a list box could be useful!  I have an app where I allow for quick browsing of my API features in a way very similar to the JMP Scripting Index.  In order to allow for the formatting that helps with visual parsing I've had to re-create list boxes using Table Box and COL Box, wrapped inside of a mouse-box to be able to know which item is being clicked on and perform certain actions based on that (like disallowing certain entries from being selected).

 

It was a lot of work, but now it is simply a widget that I can embed in any script with one line of code, just like the built-in list box.

 

The two list boxes in this script are indeed TableBoxes wrapped within a mouse box, but the added ability for individual entry formatting is undeniable. 

ErraticAttack_1-1702673667909.png

 

@SophieCuvillier , the short answer is no -- JMP does not provide any capabilities for us lowly scripters to modify the individual entries in a list box.  They do have that capability, as the JMP Scripting Index does it with the list boxes they use.

 

If you're endeavorous you can make TableBoxes behave like a list box, but it does require a bit of work.  I cannot give out my code for it per my companies regulations, but I'd be willing to help answer any questions if needed.

Jordan
hogi
Level XII

Re: Bold specific items in a list box

wow!

Re: Bold specific items in a list box

Hello,

 

Thank you very much @jthi and you for the answer. I need to highlight certain values in bold because they have a different utility for users than other values and they want to be able to differentiate them visually just by the name displayed.

 

@ErraticAttack  Your answer helped me a lot, thank you. I'm going to make a box table that mimics the behavior of a box list and bold the values I want in it.

 

 

Re: Bold specific items in a list box

What if you split the list into two lists?

Re: Bold specific items in a list box

I need to have all the values (bold and not bold) in the same place, it must be sorted by alphabetical order