I've been working with Rebol/View for a while now and I seem to be stumped
as to how I can set up an error or debugging message which will act as a
"modular" window, i.e., it stays on top until dismissed, and program
execution does not continue until it is dismissed.

I thought I had solved this with a loop that would do a do-events (see
below), but whenever it executes do-events, it never iterates and in fact
execution of the funtion is suspended until the main window is destroyed.
Here's the code as it stands:

REBOL [
        Title: "current test routine"
        Author: "Ted A. Campbell"
        Date: 1999-08-15
]

;---------------------
; generic handler for debug and error popup messages
;
myDebErr: func [ inString [string!] inTitle [string!] /local waitingForPanel
t ] [
        t: ""
        clear t
        append t inTitle
        append t ": "
        print "Enter iDebErr..."
        waitingForPanel: true
        inform layout

                title t with [ font: [ shadow: 1x1 ]]
                text inString
                button "OK" [ waitingForPanel: false hide-popup ]
                ]                       ; end of layout

        while [ waitingForPanel == true ] [ print "Waiting..." do-events ]      ;
wait...
        ; and here's the problem:
        ; code from this point is never executed until after the main window
        ; is destroyed
        print "This doesn't execute until after the main (first) window is
unviewed..."
        print "Now (at last) returning from iDebErr function..."
        return true                             ; then return
        ]

; debug pop-up message
;
myDebug: func [ inString [string!] ] [
        return myDebErr inString "DEBUG"
        ]

; error pop-up message
;
myError: func [ inString [string!] /local waitingForPanel t ] [
        return myDebErr inString "ERROR"
        ]


mainWindow: layout [
        backdrop effect [gradient 0.100.0 0.0.0]
        title "Example"
        button "Error Popup" [ myError "Hello. This is an error message from
myError." ]
        button "Debug Popup" [ myDebug "Hello. This is a debug message from
myDebug." ]
        button "Quit" [ unview/all ]
]

view mainWindow
print "done"

----

Can anyone help me figure out how to build a truly modular dialogue box with
Rebol/view?

Ted A. Campbell
[EMAIL PROTECTED]



Reply via email to