REBOL Programming/request-list

From Wikibooks, open books for an open world
< REBOL Programming
Jump to: navigation, search

USAGE:[edit]

REQUEST-LIST titl alist /offset xy 

DESCRIPTION:[edit]

Requests a selection from a list.

REQUEST-LIST is a function value.

ARGUMENTS[edit]

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

REFINEMENTS[edit]

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

SOURCE CODE[edit]

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
]