Taking JSL for a Spin

In an earlier post I discussed how the hint property of a text edit box can add some finesse to our user interface creations.

Here is another example, this time for the number edit box:

spinner

I’ve highlighted arrows that can be attached to the display box to allow the numerical value to be clicked up or down.  In other programming languages this feature is sometimes referred to as a spinner control.

In JSL the spin buttons appear when I send the message “Set Show Spin Box” to a number edit box:

New Window("test",
     neb = number edit box(2015) 
);
neb << Set Show Spin Box(1);

Except … that doesn’t work!  

Try the code and you will get a number edit box but without the spin box controls.

Here is the catch.  The spin controls increment the numeric value up or down.  The size of the increment first needs to be specified.

New Window("test",
     neb = number edit box(2015) 
);
neb << Set Increment(1);
neb << Set Show Spin Box(1);

Now you can take JSL for a spin!

 

One thought on “Taking JSL for a Spin”

Leave a Reply

Your email address will not be published. Required fields are marked *