- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Resizing Panel Box in JSL
Hi JMP Community,
I'm creating an add-in that generates a dashboard. The dashboard has a panel box with a list of options to chose from. The part of the code that specifies the panel box is shown below (I tried to make it as simple as possible by commenting lines irrelevant to the issue at hand). On running the code, the panel I get looks like this:
This is excessively wide and I want to have control over its size, but I couldn't figure out how. I have tried "<< Set Size( width, height )" and "<< Frame Size( width, height )" and they didn't work, though I'm not sure if I used them correctly, or if they are the right messages to begin with. Could you please advise me?
Thank you in advance!
Ahmed
win = Platform(
dt,
H List Box(
Panel Box( "Select option:",
plist = List Box(
points,
max selected( 1 ),
chosen = plist << get selected;
if( chosen[1] != "",
// Some simple code that runs if no option is selected.
);
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
)
)
)
);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Resizing Panel Box in JSL
Resize content inside the panel box
plist << Set Width(50)
Full example:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Reliability/TurbineEngineDesign1.jmp");
win = new window("", Platform(
dt,
H List Box(
Panel Box( "Select option:",
plist = List Box(
{"single", "double", "triple"},
max selected( 1 ),
chosen = plist << get selected;
if( chosen[1] != "",
// Some simple code that runs if no option is selected.
);
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
)
)
)
));
wait(2);
plist << set width(50);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Resizing Panel Box in JSL
Resize content inside the panel box
plist << Set Width(50)
Full example:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Reliability/TurbineEngineDesign1.jmp");
win = new window("", Platform(
dt,
H List Box(
Panel Box( "Select option:",
plist = List Box(
{"single", "double", "triple"},
max selected( 1 ),
chosen = plist << get selected;
if( chosen[1] != "",
// Some simple code that runs if no option is selected.
);
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
// Some simple code that runs if option is selected.
)
)
)
));
wait(2);
plist << set width(50);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Resizing Panel Box in JSL
Just for the benefit of everyone else, the "plist << set width( x );" only worked for me when I added it to the "Initialize()" section of the Application code.
Though, as an extension to my initial question, if you look again at the picture of the "Select option:" box above, you'll notice that it is made up of an outer and an inner boxes. The solution you suggested controls the inner nicely, but only. While the outer one would stretch with the inner, it would not shrink with it past a certain point. I tried labelling "Panel Box();" and "H List Box();" to then apply "<< set width():" to them and to "win" in the same manner, but to no avail. Any suggestions would be appreciated.
Thanks again!
Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Resizing Panel Box in JSL
Spacer Boxes can do some pretty nice things. Check out link below (especially parts 10 and 11 with Spacer Boxes):
Edit:
Also check out this great Discovery Summit presentation from 2019 A Structured Approach to Programming With JSL for Building Real World, Scalable Applications . Topic related to this starts at 22:00 minute mark but I suggest checking out the whole presentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Resizing Panel Box in JSL
Thanks for your help and for the useful links, @jthi!