[REBOL] Modular pop-up (dialogue) window in Rebol/View
From: bwbasic::bwbasic::com at: 16-Aug-2000 8:11
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
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:
Title: "current test routine"
Author: "Ted A. Campbell"
; generic handler for debug and error popup messages
myDebErr: func [ inString [string!] inTitle [string!] /local waitingForPanel
t ] [
append t inTitle
append t ": "
print "Enter iDebErr..."
title t with [ font: [ shadow: 1x1 ]]
button "OK" [ waitingForPanel: false hide-popup ]
] ; end of layout
while [ waitingForPanel == true ] [ print "Waiting..." do-events ] ;
; 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
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]
button "Error Popup" [ myError "Hello. This is an error message from
button "Debug Popup" [ myDebug "Hello. This is a debug message from
button "Quit" [ unview/all ]
Can anyone help me figure out how to build a truly modular dialogue box with
Ted A. Campbell