Vid scroller help

Discussion in 'Rebol' started by MaxV, Jun 1, 2010.

  1. MaxV

    MaxV Member

    Hello world,
    I need a help to add a scroller to a text area. I want to keep the code easy as VID, so I'm trying:
    view layout [ 
       a: area [b/state: ???
            show b]
       b: scroller [ a/para/scroll/2:   ?????
           show a
    and now?
    The refinement /para/scroll/2 controls the scrolling, but I don't know how to: get the maximum scroll text size and link it to scroll state (it is always a decimal between 0 and 1)

    Can some one light me? :confused:
  2. Graham

    Graham Developer Staff Member

    view layout [
        do [
            some-text: {}
            for i 1 10 1 [
                append some-text reduce [form system/locale/months newline]
        msg-area: area 400x100 copy some-text silver as-is
        sldr: slider 16x100 [scroll-para msg-area sldr]
    Use scoller instead of slider if you want the arrow gadgets at both ends of the slider.
  3. swhite

    swhite Member

    The code sample above is a perfect example, to me, of a major problem with REBOL. I copied out the code into a REBOL program and ran it, so I have the code, plus the result, in front of me. I am looking at the last line, and I absolutely can not understand it. If I can't understand it, I can't use it or adapt it in a program of my own.

    I went to the REBOL site and looked at the VID documents, and tried to find that word "as-is" (next-to-last line of code) to see what it means. I found nothing. I looked for a more-than-elementary example of a slider to see how one actually USES a slider, and found nothing. I looked for that "scroll-para" word to find out if it is a REBOL word, or a word defined in this script, and, if it is defined in this script, why it is in a block after the slider definition and what that block means.

    I am not writing this complaint in expectation of an answer to these questions. I am wondering where this stuff is documented so I can learn how to use it myself.

    This is related to something I have seen in some of the REBOL documents--I don't remember which ones, but I know I have seen it and I could find it. What I have seen is comments like, "this will be explained in other documents" and those other documents are nowhere to be found.
  4. swhite

    swhite Member

    Regarding my above comment, I did find out what "scroll-para" is. I typed "help scroll-para" and found that it is a function that takes two things, a text face and a scroller face, and scrolls the text based on the scroller. However, I believe that the underlying question is valid. I did not find scroll-para in the VID documentation, so where was it, and how would one learn about it if it is undocumented.

    As for understanding the example, once the example was presented, I suspected that the block after the slider keyword was a block to be executed when the slider was activated. That seems to be the form of many of the VID elements. Since msg-area and sldr were known--defined in the script--the form of that block suggested that scroll-para was a function taking those two items as parameters. Therefore, I used help to see if scroll-para was indeed a function, and it was. But still, that is too much guessing and head-beating, when a look at an indexed reference manual under "slider" would have explained it.

    I would be happy, by the way, to help write a detailed reference manual, but of course I can't do that since I can't understand REBOL without a reference manual.
  5. notchent

    notchent Member

    swite, the biggest problems I had with REBOL docs were always with VID. "help system/view/vid" or "? svv" is where you'll find answers to most of these types of questions:

         editor extract svv/vid-styles 2 ; styles ("widgets") 
         editor svv/vid-words             ; layout words 
         editor svv/facet-words         ; style facets 
         editor svv/vid-styles/TEXT-LIST/words ; additional facets for individual styles 
    Check out
  6. Graham

    Graham Developer Staff Member

    I concur. The problem with VID is that the attitude was that you could always read the sources to figure out what did what, and those of us who were not prepared to do that learned by reading other people's scripts or asking on the mailing list.

    Hopefully the docs for R3 GUI will be a lot better if only because they will be wiki'fied so that trusted users will be able to update them.
  7. MaxV

    MaxV Member

Share This Page