Frontscript to simulate modal dialog

Frank Leahy frank at
Fri May 21 19:06:24 CDT 2004


> The only thing you can do about this AFAIK is to have a resumeStack 
> handler
> on the other windows that have code that checks to see if the progress
> window is in open, and if so, to re-open the progress bar window 
> (which will
> bring it to the front). You'll have an odd "toggle" sort of situation 
> going
> on (where for a fraction of a second the dialog is submerged), but 
> it'll
> keep people from messing up other windows.

I've done that, and it works some of the time, but not all the time.  I 
may have to add a timer to check that the progress window has actually 
been brought forward after 1 second or so.

> Another option is to use a palette window for your progress bar and 
> have
> each "normal" window have a transparent button that sits in front of
> everything else on that window. Normally it is hidden, but when the 
> progress
> bar is going it becomes visible. When the progress bar goes away, this
> button is hidden again. This prevents "submarining" of the progress 
> window
> (since it's a palette), and also prevents clicks on the other windows 
> (since
> the transparent button gets in the way).

I'd thought of the transparent button, but not using it in conjunction 
with a palette because I'd assumed that the palette would have a 
palette-like border.  But I'll try that, thanks.

By the way, I'm surprised that this frontscript doesn't actually trap 
any mouseDown's, is anyone else surprised?

on mouseDown
   put the rect of window "Thumbnail Progress" into theRect -- this is 
the progress dialog window
   put the screenMouseLoc into theLoc
   if theLoc is within theRect then
     pass mouseDown
   end if
end mouseDown

-- Frank

More information about the use-livecode mailing list