Dear REBOL list,

After some years and a change of management, I have permission to purchase =
the SDK and do an official, if small, REBOL project.  So I am trying to =
remember how to use REBOL, am getting started on a test project as a =
warm-up, and have run into the following question:

I am trying to make a little program for several people to use, and one of =
them is visually impaired, so I want to put a button on the screen that =
will make everything on the screen bigger (small, medium, large).  I have =
gotten started, and can make the screen, the buttons, and the button text =
change size.  BUT, in the test script below, if I make buttons larger, =
they start to overlap adjacent buttons because I can't figure out how to =
make the spacing between the buttons larger.  And that is the question.  I =
thought that I would be able to change tab stops, and three lines in the =
script commented out with ";;test" show that attempt, but the "/tabs" path =
on a layout seems to be not allowed.  Am I doing it wrong, or is there =
another way?

Thank you.

The script below, if cut and pasted into a text file, should run and show =
the situation.
-----------
REBOL [ ]

;;  This is a test script to show how to change the size of
;;  a window, with all the stuff on it, in response to a
;;  choice button that gives the choice of "small," "medium,"
;;  or "large."
;; =20
;;  Comment lines markes with ;;test, when un-commented, will
;;  cause the script to fail, and are the source of the
;;  current question.


;;  Define sizes

SIZE-SCREEN-SMALL: 640X480
SIZE-SCREEN-MEDIUM: 800X600
SIZE-SCREEN-LARGE: 1024X768

SIZE-BUTTON-SMALL: 60X20
SIZE-BUTTON-MEDIUM: 100X40
SIZE-BUTTON-LARGE: 140X60

SIZE-TEXT-SMALL: 12
SIZE-TEXT-MEDIUM: 16
SIZE-TEXT-LARGE: 24

SIZE-TABS-SMALL: 70
SIZE-TABS-MEDIUM: 110
SIZE-TABS-LARGE: 150

;;  Set default sizes

SIZE-SCREEN: SIZE-SCREEN-SMALL
SIZE-BUTTON: SIZE-BUTTON-SMALL
SIZE-TEXT: SIZE-TEXT-SMALL
SIZE-TABS: SIZE-TABS-SMALL

;;  These are functions to set the size variables to
;;  small, medium, or large

SET-TO-SMALL: does [
    SIZE-SCREEN: SIZE-SCREEN-SMALL
    SIZE-BUTTON: SIZE-BUTTON-SMALL
    SIZE-TEXT: SIZE-TEXT-SMALL
    SIZE-TABS: SIZE-TABS-SMALL
]

SET-TO-MEDIUM: does [
    SIZE-SCREEN: SIZE-SCREEN-MEDIUM
    SIZE-BUTTON: SIZE-BUTTON-MEDIUM
    SIZE-TEXT: SIZE-TEXT-MEDIUM
    SIZE-TABS: SIZE-TABS-MEDIUM
]

SET-TO-LARGE: does [
    SIZE-SCREEN: SIZE-SCREEN-LARGE
    SIZE-BUTTON: SIZE-BUTTON-LARGE
    SIZE-TEXT: SIZE-TEXT-LARGE
    SIZE-TABS: SIZE-TABS-LARGE
]

;;  This is a procedure to apply the settings to the=20
;;  MAIN-WINDOW

APPLY-SETTINGS: does [
    MAIN-WINDOW/size: SIZE-SCREEN
    MAIN-CHOICE/size: SIZE-BUTTON
    MAIN-CHOICE/font/size: SIZE-TEXT
    MAIN-QUIT/size: SIZE-BUTTON
    MAIN-QUIT/font/size: SIZE-TEXT=20
;;test    MAIN-WINDOW/tabs: SIZE-TABS
;; error will be on the line above, setting MAIN-WINDOW/tabs
]

;;  This is the procedure performed when the choice button
;;  is pressed.

EX-CHOICE-BUTTON: does [
    if =3D MAIN-CHOICE/text "small" [
        SET-TO-SMALL
        APPLY-SETTINGS
        view MAIN-WINDOW
    ]
    if =3D MAIN-CHOICE/text "medium" [
        SET-TO-MEDIUM
        APPLY-SETTINGS
        view MAIN-WINDOW
    ]
    if =3D MAIN-CHOICE/text "large" [
        SET-TO-LARGE
        APPLY-SETTINGS
        view MAIN-WINDOW
    ]
]

;;  Define the main (only) screen

MAIN-WINDOW: layout [
    size SIZE-SCREEN
;;test tabs SIZE-TABS
    origin 10x10
    across
    MAIN-CHOICE: choice SIZE-BUTTON
        font [size SIZE-TEXT]
        "small" "medium" "large"=20
        [EX-CHOICE-BUTTON]
;;test tab
    MAIN-QUIT: button SIZE-BUTTON
        font [size SIZE-TEXT]
        "Quit"
        [quit]
]

;;  Run the program

view MAIN-WINDOW



-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to