2

The librarian (http://www.rebol.org/download-librarian.r) has a very neat way to display data, on the main list. I would like to use this kind of "widget" in another project, to display data from a database.

I tried quickly to look at the code, but it does not seem very generic, nor designed to be re-used.

Is there a way to package this code into something re-usable? Has anyone done it yet?

2
  • I tried to hack the code, trying to add a column. Not a success: no additional column appeared, and all data is mangled now. Oops. Reverted to original...
    – Pierre
    Commented Oct 15, 2013 at 17:49
  • I added a link to open the selected file in the editor
    – sqlab
    Commented Feb 4, 2014 at 13:23

1 Answer 1

0

It wasn't designed to be reused because the LIST style is really doing all the work. There is an example on rebol.org that may help (http://www.rebol.org/view-script.r?script=list-supply-how-to.r), but I'll make a couple points here.

The two most important facets of the LIST style are the first block (after the size in this case), and the SUPPLY facet which is also a block.

The first block is the layout spec. Don't think in terms of columns, think in terms of embedded layouts (or panes, or sub-windows if you prefer). The layout spec you provide (which you can test independently using VIEW LAYOUT [...]), is iterated in the list, and the set-word! values that name the fields are what you use in the supply block to set the value in each face for a given "row". http://www.rebol.org/view-script.r?script=list-scroll-demo.r might be a simpler example to play with, to help you get the idea.

Not the answer you're looking for? Browse other questions tagged or ask your own question.