Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-8 of 8 total  RSS 

face-words - Returns a block of words that refer to faces in a face's pane.

    face-words: func [
        "Returns a block of words that refer to faces in the face's pane."
        face
    ][
        remove-each item collect word [foreach f face/pane [word: f/var]] [none? item]
    ]

add face to pane snippet

add-button: does [
    append lay/pane layout/offset [
        button [alert "I'm new!"]
    ] 100x100
    show lay
]
view lay: layout [size 400x300 button [add-button]]

add face to pane snippet

add-button: does [
    append lay/pane layout/offset [
        button [alert "I'm new!"]
    ] 100x100
    show lay
]
view lay: layout [size 400x300 button [add-button]]

add face to pane snippet

add-button: does [
    append lay/pane layout/offset [
        button [alert "I'm new!"]
    ] 100x100
    show lay
]
view lay: layout [size 400x300 button [add-button]]

reset-faces function

reset-faces: func [
    faces [block!] "Block of face objects, or words that refer to faces."
][
    foreach face faces [
        reset-face either object? face [face] [get face]
    ]
]

clear-faces function

clear-faces: func [
    faces [block!] "Block of face objects, or words that refer to faces."
][
    foreach face faces [
        clear-face either object? face [face] [get face]
    ]
]

bring-to-front and send-to-back functions

bring-to-front: func [face] [
    append remove find face/parent-face/pane face face
    show face
]

send-to-back: func [face] [
    insert head remove find face/parent-face/pane face face
    show face/parent-face
]

click-face function

click-face: func [
    "Simulate a mouse click" 
    face
][
    face/feel/engage face 'down none
]
« Newer Snippets
Older Snippets »
Showing 1-8 of 8 total  RSS