Rebol Programming/view

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

USAGE:[edit | edit source]

VIEW view-face /new /offset xy /options opts /title text 

DESCRIPTION:[edit | edit source]

Displays a window face.

VIEW is a function value.

ARGUMENTS[edit | edit source]

  • view-face -- (Type: object)

REFINEMENTS[edit | edit source]

  • /new -- Creates a new window and returns immediately
  • /offset
    • xy -- Offset of window on screen (Type: pair)
  • /options
    • opts -- Window options [no-title no-border resize] (Type: block word)
  • /title
    • text -- Window bar title (Type: string)

SOURCE CODE[edit | edit source]

view: func [
    "Displays a window face." 
    view-face [object!] 
    /new "Creates a new window and returns immediately" 
    /offset xy [pair!] "Offset of window on screen" 
    /options opts [block! word!] "Window options [no-title no-border resize]" 
    /title text [string!] "Window bar title" 
    /local scr-face
    scr-face: system/view/screen-face 
    if find scr-face/pane view-face [return view-face] 
    either any [new empty? scr-face/pane] [
        view-face/text: any [
            all [system/script/header system/script/title] 
            copy ""
        new: all [not new empty? scr-face/pane] 
        append scr-face/pane view-face
    ] [change scr-face/pane view-face] 
    if all [
        view-face/feel = system/view/vid/vid-face/feel
    ] [
        view-face/feel: window-feel
    if offset [view-face/offset: xy] 
    if options [view-face/options: opts] 
    if title [view-face/text: text] 
    show scr-face 
    if new [do-events]