A Word To The Wise

Rob Cozens rcozens at pon.net
Thu Sep 5 13:12:13 EDT 2002


I just spent considerable time and mental energy trying to find the 
solution to a problem I caused myself.

I have found it is more efficient to maintain one mouseUp handler for 
a group of navigation buttons than to maintain handlers in the 
scripts of the individual buttons.  This is easy enough to do using a 
switch control based on the short name of the target; so when it 
became necessary to add new functionality to mouseUp handlers in an 
old button group I consolidated the mouseUp handlers of the 
individual buttons into one handler in the group's script.

When testing both the new and old functionality, I found myself in a 
situation where individual buttons were displayed as enabled/disabled 
but no enabled button would respond to mouseUp.  When I put a trace 
in the group mouseUp script, the results showed that while I was 
clicking on an enabled button, the target of the mouseUp passed to 
the group was the card itself.

To make a long story short, I found that I hand neglected to change 
"disable/enable me" in some of the imported button scripts to 
"disable/enable button (the short name of the target)".  Even though 
some buttons were enabled, they would not respond to mouseUp because 
the group had disabled itself...with no visual indication this was so.
-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)



More information about the use-livecode mailing list