debugging modal dlg boxes
charles.hartman at conncoll.edu
Mon Oct 17 08:07:43 EDT 2005
On Oct 17, 2005, at 12:47 AM, J. Landman Gay wrote:
> 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.
Ah, OK. The cost of the app (stack) and IDE not being distinct, for
the sake of avoiding compilation. Hm.
> 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-
Excellent; that's what I need.
> 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. ;)
I got into a situation in which a dialog had to be modal, and what it
did *as* modal was what I needed to debug . . . Which isn't exactly
*why* I've abandoned that trial design for this app, but it does make
me glad I did.
More information about the Use-livecode