Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Little questions, big answers...

From: dness:home at: 6-Sep-2001 9:33

Anton wrote:
> I thought you wanted to do that! > I don't recommend writing a file. > That's more work than necessary. > > lay: layout [size 300x300] > repeat n 10 [ > append lay/pane make get-style 'field compose [ > offset: (n * 10x28) > text: (join "field" n) > ] > ] > view lay > > To see how this works, you will need to know how > make, compose and get-style work. But here is an > example of the above that requires more manual > labour. > > lay: layout [size 300x300] > > append lay/pane make get-style 'field [] > lay/pane/1/offset: 10x10 > view lay ; now close the window > > append lay/pane make get-style 'field [] > lay/pane/2/offset: 20x40 > view lay > > Get-style takes a word like 'field and returns > you a pointer to the default, "archetype", field face > that is set up by rebol VID. > > Make makes a copy of that object so we have our own. > Without make there, we would be modifying one face, > and appending it multiple times to the pane list. > > You can do it, but they will all have the same > position, size, text, etc. which will cause you > problems. > > There is also list. > > view layout [list [field] data [["hello"] ["there"]]] > > This requires a bit of work to set up and > manipulate, but there are docs lying around. >
This is another very useful answer, which leaves me dangerously close to thinking I actually understand what is going on! Last night I implemented the write file/read file solution, and it works quite well, and it has the advantage ob being (conceptually) almost simple and applicable to problems that arise in other context. However, I will try the approach you suggest as it is clear to me I will learn something by doing so. Thanks again for you effort and help.