debugging modal dlg boxes
J. Landman Gay
jacque at hyperactivesw.com
Mon Oct 17 00:47:41 EDT 2005
Charles Hartman wrote:
> I know this is a dumb question -- but I'm having a hard time debugging
> a modal dialog box. What am I missing?
>
> When the box is full, the "Done" button processes its data (and sends
> it off to a MySQL database). But debugging the mouseUp script for that
> button isn't working -- because when I try to stop at a breakpoint in
> it, though the script does stop, I can't click in it, or in anything
> else at all: menus, message box, the Done button itself . . . so
> there's nothing to do but Force Quit, which doesn't exactly give me the
> information I need for debugging.
>
> Is there some method for debugging modals that I don't know about?
> Can't find anything in the docs . . .
Unless you have put in some kind of escape route for debugging, you are
stuck. Modals just don't allow anything else to happen until they are
dismissed.
Fortunately, Rev has a built-in escape from these. Hold down
Command-Control-Shift (on Mac, anyway) and click on the stack; you'll
get the contextual menu that allows you to change the stack style to
something other than modal. Then you won't have to force-quit.
While debugging, I usually call the stack in some other mode until I
know it works; toplevel, or modeless, or anything besides modal. Once it
is working correctly, then I change the code back to modal. Note that
modal dialogs are universally hated and shouldn't be used unless
absolutely necessary. ;)
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list