< Rebol Programming
USAGE:
REQUEST-DIR /title title-line /dir where /keep /offset xy
DESCRIPTION:
Requests a directory using a popup list.
REQUEST-DIR is a function value.
REFINEMENTS
- /title -- Change heading on request.
- title-line -- (Type: any)
- /dir -- Set starting directory
- where -- (Type: file)
- /keep -- Keep previous directory path
- /offset
- xy -- (Type: any)
SOURCE CODE
request-dir: func [
"Requests a directory using a popup list."
/title "Change heading on request." title-line
/dir "Set starting directory" where [file!]
/keep "Keep previous directory path"
/offset xy
][
if block? dirout [
dirout: layout dirout
max-dirs: to-integer f-list/size/y - 4 / f-txt/size/y
center-face dirout
]
set-face f-title any [title-line "Select a directory:"]
if not all [keep path] [
path: copy either where [clean-path where] [what-dir]
]
if all [not empty? path slash = last path] [remove back tail path]
last-path: path
result: none
show-dir
either offset [inform/offset dirout xy] [inform dirout]
result
]
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.