Identifying objects by their tooltips

Alex Tweedly alex at tweedly.net
Mon Nov 21 08:27:57 EST 2005


Mathewson wrote:

>So I am working on some EFL programs for very young
>children and ended up with a lots of drag and drop images -
>now I could spend lines and lines of code of the sort:
>
>if the name of it is "COW.gif" then do TIDDLEY POM
>
>identifying each image individually - tedious, memory
>hungry and inefficient.
>
>Now I may have reinvented the wheel - notwithstanding this
>might be a happy trick to share with the 'basic educational
>stack' crowd to which I proudly belong:
>
>if you have a class of objects to be dragged and dropped
>(or somesuch) set the tooltip of all of them to some
>'invisible' text such as 3 spaces and then use the
>following:
>
>if the tooltip of it is "   " then do WHAT YOU FANCY
>
>  
>
I may be missing something ...
what is the advantage of using tooltips over simply setting a custom 
property ?

if the cWhatDoYouFancy of it is true then do WHAT YOU FANCY

This leaves the tooltips available (should you want) for their normal 
use, and each image can have multiple of these as needed

 if the cDragAndDroppable of it is true then do DRAG IT
 if the cMultiColoured of it is true then do ConvertToGreyScale
 ...

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/176 - Release Date: 20/11/2005




More information about the use-livecode mailing list