Weird button behavior

Peter Haworth pete at mollysrevenge.com
Sat Feb 5 18:31:58 EST 2011


I just figured out what was going on and I guess it's worth mentioning since it points out the dangers of testing modal dialogs.

In the preOpenCard handler for the modal dialog there was this statement:

set the width of this card to 425

This, of course, is not a valid statement since cards don't have a width property.  In a non modal dialog, this would have thrown a runtime error but I guess since this was a modal dialog, the error was somehow suppressed, or at least not shown in the script window.  Strangely, the modal dialog was still displayed even though processing stopped in preOpenCard. Nevertheless, once I corrected the error, the modal dialog worked just fine.

So I guess now my question for the community is - What techniques do you use to test modal dialogs?  

Pete Haworth

On Feb 5, 2011, at 2:36 PM, J. Landman Gay wrote:

> On 2/4/11 7:39 PM, Peter Haworth wrote:
>> Strange thing happening, actually not happening, when I click on a
>> button in a modal dialog window.  I have a mouseUp handler for the
>> button with a few lines of code ending with a close this stack
>> statement.  The stack closes but setting break points shows that
>> neither the close statement nor any of the other statements in the
>> handler are executed, neither is any of the code in the script that
>> opened the modal dialog.
>> 
>> If I open the card from the Application browser so (it's not modal),
>> when I click the button, all the code is executed.
>> 
>> Can anyone suggest what might be causing this?
> 
> I think your script is running normally, unless you have symptoms you haven't mentioned. Debugging a modal window doesn't always work. You'll get varying results. Instead of setting a breakpoint, put some info into the message box temporarily so you can see which lines of script are running. Since the window does close as directed, I'm betting the rest of the lines of script are also running.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 





More information about the Use-livecode mailing list