Just recently, I learned, through a little discussion on the REBOL facebook page, that it is inadvisable to set the text of a text face with a command like "face-name-1/text: text-name-1", but instead to use the set-face function.
A few months ago I wrote myself a little demo of a demo program, where I display some instructions in a text area and page through pages of text with a "next" button. This text area also had a scroller next to it because sometimes the text was longer than the area I set up for it. The code to load the text area with the next page of text, reset the scroller, and display the new text, looked like this:
LOAD-TEXT-AREA: func [PAGE] [
CURRENT-TEXT: copy ""
CURRENT-TEXT: pick LESSON-TEXTS PAGE
TEXT-AREA/text: CURRENT-TEXT
TEXT-AREA/para/scroll/y: 0
TEXT-AREA/line-list: none
TEXT-AREA/user-data: second size-text TEXT-AREA
TEXT-SCROLLER/redrag TEXT-AREA/size/y / TEXT-AREA/user-data
show TEXT-AREA
]
This worked find initially, but as I paged through pages of text, and ran associated samples of code by means of another button, at some point the text on my buttons that I used to page through text would disappear. The buttons would work, but they would be blank.
So, using my new-found knowledge, I changed the above procedure to look like this:
LOAD-TEXT-AREA: func [PAGE] [
CURRENT-TEXT: copy ""
CURRENT-TEXT: pick LESSON-TEXTS PAGE
;; TEXT-AREA/text: CURRENT-TEXT
set-face TEXT-AREA CURRENT-TEXT
TEXT-AREA/para/scroll/y: 0
TEXT-AREA/line-list: none
TEXT-AREA/user-data: second size-text TEXT-AREA
TEXT-SCROLLER/redrag TEXT-AREA/size/y / TEXT-AREA/user-data
;; show TEXT-AREA
]
Notice that I now set the text with the set-face function, and I don't use the "show" function anymore. This also works fine, and I seem to be no longer having problems with the text on the buttons disappearing.
So, the question is, if setting the text value of a face by means of the previous method is "face hacking" and not recommended, is there also a recommended procedure for setting those other attributes of the text area that seem to need setting for the scroller to work? The word TEXT-AREA is a 500x400 face of type "text" and TEXT-SCROLLER is a 16x400 scroller that I use to scroll the text withing TEXT-AREA. Those other attributes I am setting are items I located from a REBOL cookbook entry that explained how to use a scroller to move an area of text. I don't actually know what I am doing with them. I just examined the cookbook example until I thought I understood it, and then used that code whenever I want to scroll text.
Or, am I actually doing things correctly, since they do work?
Thank you.