how to change the space when the screen size is changing ?

Started by Mennohexo on 26-Jun-2017/9:12:12-7:00
Hi , we spoke about the screensize variable and how to get it in Rebol. It works. Here is a simple code example from the REBOL/View Tutorial that describes the space command. Let us assume the user is starting the application on a computer with greater screen. Now it is better to take a greater space between the widgets , but how to make the space command to get a variable value ? Example : not space 20x16 but such like space AxB And A contains the value 40 B contains the value 32 i assume there is a syntax error. How to make that anyhow ? space 20x16 button 'Button 1' button 'Button 2' return button 'Button 3' button 'Button 4'
COMPOSE works well for this sort of thing: A: 40 B: 32 view layout compose [ space (to-pair reduce [A B]) button 'Button 1' button 'Button 2' return button 'Button 3' button 'Button 4' -] -
In this case, parentheses are evaluated in the layout block (without 'compose), and 'as-pair is a few characters simpler: A: 40 B: 32 view layout [ space (as-pair A B) button 'Button 1' button 'Button 2' return button 'Button 3' button 'Button 4' ]
Thanks Nick./It works well.

Reply