REBOL [
    Title: "Walk VID"
    Date: 19-Jun-2011
    Author: "Christopher Ross-Gill"
]

walk-vid: use [level][
    level: 0

    func [[catch] face [object!] callback [function!] /deep][
        unless in face 'pane [throw make error! "Not a face"]
        level: either deep [level + 1][bind second :callback 'level 0]

        do [callback face]
        case [
            block? face/pane [
                foreach pane face/pane [walk-vid/deep pane :callback]
            ]
            object? face/pane [
                walk-vid/deep face/pane :callback
            ]
        ]
        level: either deep [level - 1][0]
        face
    ]
]