JSL: How to change the width of a combo boxHi All,
I am working on some JSL code where I have some combo boxes listed in a V List Box(); The lists for the combo boxes are all of different character lengths, but I'd like the combo boxes to all have the same width.
The normal <
Tried looking this one up, but most discussions are about Text Boxes() or other similar items, not Combo Boxes().
Any suggestions help.
Thanks!,
DS
Advanced Statistical ModelingAutomation and ScriptingConsumer and Market ResearchDesign of ExperimentsMass CustomizationRe: JSL: How to change the width of a combo boxThe combo box actually does respond to "<
Names Default To Here( 1 );
New Window( "test", a = Combo Box( {"i"} ) );
Show( a << Get Width ); //31
a << Set Width( 100 );
Show( a << Get Width ); //100
Wait( .1 );
Show( a << Get Width ); //31As for the wider Combo Box you are seeing when the list is only {"i"}, that appears to be an operating system issue. As you can see, I get a width of 31, running Windows 11.
Re: JSL: How to change the width of a combo boxQuick correction to my post. In the "PPS", I was speaking about the "Set Width" command, not the Get Width. Get Width seems to work on combo boxes. Sorry for any confusion.
Re: JSL: How to change the width of a combo boxDoes anyone have any ideas on how to make a combo box narrower instead of wider? Even if I change the items in my list to single characters only, the combo box width seems to have a mind of its own:
Names Default To Here(1);
New Window("Example",
cb = Combo Box({"i"})
);
cb << Get Width;With the example above, the width is 107. This is way too large for a single letter, in my opinion. But if I add a "j" to the list, so the list is {"i", "j"}, the width actually gets narrower, and goes to 71. Anyone know why?
PS: I'm using JMP Pro 17.1.0 and MacOS Ventura 13.4.1.
PPS: replying to @txnelson : Question about the scripting index... The "<< Get Width" command isn't listed under "Item Messages" for Combo Box, but it is listed under "Shared Item Messages". I've often been confused by this, bc it seems to suggest the user should be able to apply << Get Width to a combo box. But as discussed here, that doesn't seem to be the case. If the commands in this "Shared Item Messages" section aren't necessarily able to be used on the display box, what is the meaning behind that section (asking sincerely...I am genuinely curious). Thanks!
Re: JSL: How to change the width of a combo boxHi @ErraticAttack and @txnelson ,
Thanks for your quick feedback. I tried the escape characters, but they don't always work as expected due to the difference in character length of the multiple different combo boxes and their entries. I ended up going with @ErraticAttack's solution as the Lineup Box() environment worked perfectly. Now, I'll go back and change my other code because I was using nested H List Box() and V List Box() environments with Spacer Box(Size()) entries to edit the aesthetics of the GUI. The Lineup Box() works great and is pretty easy and intuitive.
Thanks for the help!,
DS
Re: JSL: How to change the width of a combo boxThe builtin LineupBox is designed just for this case, example:
Names Default To Here( 1 );
New Window( "Example",
Lineup Box( N Col( 1 ), Spacing( 0, 2 ),
Spacer Box( Size( 120, 0 ) )
,
cb = Combo Box(
{"One", "Two", "Three"},
selection = cb << GetSelected();
Print( "Selected: " || selection );
)
,
cb2 = combo box( {"a","b","c"} )
);
);Re: JSL: How to change the width of a combo boxThe Scripting Index for ComboBox shows all messages that can be set. Width is not one of them. However I have be able to handle the need by embedding non printable characters. Here is an example
Names Default To Here( 1 );
New Window( "Example",
cb = Combo Box(
{"One\!t", "Two", "Three"},
selection = cb << GetSelected();
Print( "Selected: " || selection );
),
cb2 = combo box( {"a \!t","b","c"})
);
