On Jan 20, 2016, at 10:14 , Mark Waddingham 
<m...@livecode.com<mailto:m...@livecode.com>> wrote:

For example, many document-centric apps will have a 'Save' function. On Mac 
this is typically 'just' in the File menu. However, on Windows it is usual to 
have it both in the File menu *and* as a button on a document's toolbar. If the 
code for the 'save' action is not factored out you end up with duplicated code 
- so it is quite natural to move this code 'down' into core logic.

Oh right yes I do that too. As soon as I need to access the same code from 
multiple locations, I will often do that, but sometimes I will just send a 
mouseUp (or call a handler) from the object itself. A lot has to do with 
whether or not the object script has relative references to itself of the 
card/stack it belongs to. Sometimes moving complex code requires a lot of 
refactoring, so rather than do that, I just send or dispatch to the handler in 
the object, rather than go through the nonsense of re-debugging everything all 
over again.

Bob S

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to