A theme parameter starts its life in the theme's rtconfig, with a (still undocumented, sorry) 'define_parameter' declaration. In Default6, I do this using my 'indexParams' macro, because I chose to do my params as numbers. For example:
Code:
indexParams 'A_tcp_vol_size' 1 1 7 3
min value is 1, max is 7. So if you want more values, first thing is to raise the max value there.
Ok, now we can go to the script. Here's the control for the volume size:
Code:
Spinner:new(_layoutTrack, {x=192,y=29,w=127,title='VOLUME SIZE',action=paramSet,param='tcp_vol_size',valsTable=tcpVolVals})
which references 'tcpVolVals' ...that's just a table of strings to display to the script user. Add more if you add more values.
The script sends the theme the chosen value as a number. Back in the theme, for each layout I use that number to alter a WALTER scalar, using a 'set scalar' command. I have also wrapped that into a macro, which I called 'paramPair'.
Code:
paramPair tcp_VolSize 3 20 40 70 100 130 160 190
that line creates a scalar (tcp_VolSize), attaches it to a param index (3) and then lists the values that WALTER will use (20, 40, etc).
---------------
SO: To add one new value to the tcp volume size:
1 In the rtconfig, increase the max value of "indexParams A_tcp_vol_size" by one.
2 In the script, add an extra string to 'tcpVolVals'. Could be anything. Perhaps a rude word. Just something to show the user.
3 In the rtconfig, add an extra entry to "paramPair tcp_VolSize" that is the actual pixel size you want to see as the result.