Rebol Programming/request-list

From Wikibooks, open books for an open world
Jump to navigation Jump to search

USAGE:[edit | edit source]

REQUEST-LIST titl alist /offset xy 

DESCRIPTION:[edit | edit source]

Requests a selection from a list.

REQUEST-LIST is a function value.

ARGUMENTS[edit | edit source]

  • titl -- (Type: string)
  • alist -- (Type: block)

REFINEMENTS[edit | edit source]

  • /offset
    • xy -- (Type: any)

SOURCE CODE[edit | edit source]

request-list: func [
    "Requests a selection from a list." 
    titl [string!] 
    alist [block!] /offset xy /local rslt list-lay
][
    list-lay: layout [
        origin 10x10 
        h3 titl 
        text-list data alist [rslt: value hide-popup] 
        btn-cancel #"^[" [rslt: none hide-popup]
    ] 
    rslt: none 
    either offset [inform/offset list-lay xy] [inform list-lay] 
    rslt
]