Detecting SelectedObjectChanged When Clicking Another Control?

dunbarx at aol.com dunbarx at aol.com
Fri Sep 27 19:43:19 EDT 2013


Scott.


Oh, I see, you want to know when you deselect, and there is no "deSelectedObjectChanged" message.


Can't you set a custom property when the object of interest is selected, and check the target when the "selectedObjectChanged" message fires, and if that new target is not that original object, let you know?


Craig



-----Original Message-----
From: Scott Rossi <scott at tactilemedia.com>
To: LiveCode Mail List <use-livecode at lists.runrev.com>
Sent: Fri, Sep 27, 2013 7:16 pm
Subject: Detecting SelectedObjectChanged When Clicking Another Control?


Hi All:

I recently ran into a situation where I need to trap selectedObjectChanged
after clicking on something other than the selected control (as opposed to
clicking on the card where nothing is selected).  Can you detect this
without resorting to a front/backScript or a card/stack-level script?

I have a control that changes its state when it is selected, and I need to
revert that state when the object is deselected.  Starting with the
selected control, if I click on the card (click nothing), the control gets
the selectedObjectChanged message and can be reset.  But if I click on
another object, there doesn't seem to be a built-in way for the control to
detect this.

I've resorted to loading a backScript to tell the original control that it
has been deselected, but this seems fragile and I'm wondering if there's a
better way to handle this.

Thanks for suggestions.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design



_______________________________________________
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