cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar

Query about Line Up Box behavior

Hi,

In the following script fragment I've defined an array of six button boxes within a Line Up Box five slightly different ways in as many different windows.  In the first window I don't bother to specify the width of any of the buttons – no problem.  In the second and third windows, I specify that I want one of the two columns to be a specific width by setting the width of just one of the buttons in that column – again, no problem.  In the fourth window I specify the width of both columns by setting the widths of the second and fifth buttons – no problem.  But when I try to do the same thing on the first and second buttons in the fifth window, it doesn’t work: the first two buttons don’t appear in the window.  I've tried this in both JMP 10 and JMP 11 with the same result.

I don't think I've done anything silly here, so why is this please?  I'd like to understand this because I may need to create a window in an application on which I'm working in which there are a variable number of buttons in two columns of specified width - and there could be just two of them, in which case I'm likely to encounter just this issue.

nw1 = new window("NW1",   

       LineUpBox(ncol(2),

              Button Box("A"), Button Box("X"),

              Button Box("B"), Button Box("Y"),

              Button Box("C"), Button Box("Z"),

              )

       );

nw2 = new window("NW2",

       LineUpBox(ncol(2),

              Button Box("A"), Button Box("X", << set width(200)),

              Button Box("B"), Button Box("Y"),

              Button Box("C"), Button Box("Z"),

              )

       );

nw3 = new window("NW3",   

       LineUpBox(ncol(2),

              Button Box("A", << set width(200)), Button Box("X"),

              Button Box("B"), Button Box("Y"),

              Button Box("C"), Button Box("Z"),

              )

       );

nw4 = new window("NW4",   

       LineUpBox(ncol(2),

              Button Box("A"), Button Box("X", << set width(200)),

              Button Box("B"), Button Box("Y"),

              Button Box("C", << set width(200)), Button Box("Z"),

              )

       );

nw5 = new window("NW5",  

       LineUpBox(ncol(2),

              Button Box("A", << set width(200)), Button Box("X", << set width(200)),

              Button Box("B"), Button Box("Y"),

              Button Box("C"), Button Box("Z"),

              )

       );

Many thanks for any insight offered.

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager

Re: Query about Line Up Box behavior

,

Thanks for the detailed description and the scripts.

You're not doing anything wrong. It looks like a bug that we'll have to address in a future maintenance version. We've documented the bug internally and will fix it at the first opportunity.

In the meantime, you can workaround it by setting the width after the buttons are created rather than as a part of the instantiation.

nw5 = New Window( "NW5",

      Lineup Box( N Col( 2 ),

            Button Box( "A" ), Button Box( "X" ),

            Button Box( "B" ), Button Box( "Y" ),

            Button Box( "C" ), Button Box( "Z" )

      )

);

nw5[buttonbox(1)] << set width(200);

nw5[buttonbox(2)] << set width(200);

Obviously your subscripting could be different depending on what's already in your window. Alternatively you could assign the button references to a JSL variable and use that in the Set Width() message.

Sorry for the difficulty.

-Jeff

-Jeff

View solution in original post

4 REPLIES 4
pmroz
Super User

Re: Query about Line Up Box behavior

Weird behavior.  I got #5 to work this way:

nw5 = new window("NW5", 

       LineUpBox(ncol(2),

       ab = Button Box("A"),

       xb = Button Box("X"),

              Button Box("B"), Button Box("Y"),

              Button Box("C"), Button Box("Z"),

       ),

);

ab << set width(200);

xb << set width(200);

ms
Super User (Alumni) ms
Super User (Alumni)

Re: Query about Line Up Box behavior

Weird indeed. For ncol(3) and above it works, but not for ncol(1) and ncol(2). In the display tree for nw5, all six button boxes are listed despite not appearing in the rendered window.

Jeff_Perkinson
Community Manager Community Manager

Re: Query about Line Up Box behavior

,

Thanks for the detailed description and the scripts.

You're not doing anything wrong. It looks like a bug that we'll have to address in a future maintenance version. We've documented the bug internally and will fix it at the first opportunity.

In the meantime, you can workaround it by setting the width after the buttons are created rather than as a part of the instantiation.

nw5 = New Window( "NW5",

      Lineup Box( N Col( 2 ),

            Button Box( "A" ), Button Box( "X" ),

            Button Box( "B" ), Button Box( "Y" ),

            Button Box( "C" ), Button Box( "Z" )

      )

);

nw5[buttonbox(1)] << set width(200);

nw5[buttonbox(2)] << set width(200);

Obviously your subscripting could be different depending on what's already in your window. Alternatively you could assign the button references to a JSL variable and use that in the Set Width() message.

Sorry for the difficulty.

-Jeff

-Jeff

Re: Query about Line Up Box behavior

Excellent - many thanks Jeff.  Good to know I'm not going crazy!