AW: How to hilite a checkbox with send mouseup?
form at nonsanity.com
Tue Feb 15 15:29:54 CST 2011
This works with a checkbox button...
Checkbox button named "Check":
put the hilite of me into msg
set hilite of me to not hilite of me
Some other button:
send MouseUpWithHilite to btn "Check"
However it does not work so well with a regular button. The effects of
hilite on a regular button don't match the effect of clicking it. The effect
could probably be duplicated, but hilite isn't enough in itself. And it
would also need to be changed from a toggle effect to a delayed effect like
set hilite of me to true
send StopHilite to me in 1 sec
set the hilite of me to false
But as I said, the hilite by itself isn't enough. Probably need to add some
color change, etc.
This method has one advantage over "click at" however, in that it works even
if the checkbox is hidden, in another stack, behind another object, off the
edge of the card, or blocked by another window. The "click at" command would
fail to handle those situations properly.
~ Chris Innanen
On Tue, Feb 15, 2011 at 12:30 PM, Robert Brenstein <rjb at robelko.com> wrote:
> On 15.02.11 at 12:14 -0500 Nonsanity apparently wrote:
>> It would be better to do something like add another handler to the button:
>> on MouseUpWithHilite
>> set hilite of me to not hilite of me
>> end MouseUpWithHilite
>> And send THAT message to the button from afar. This way, the existing
>> MouseUp handler in the button works as expected, and this message has the
>> same result as clicking the button (toggling the hilite in the process)
>> enacting the MouseUp handler.
>> ~ Chris Innanen
>> ~ Nonsanity
> The above won't work as intended, it will turn the hilite on for good.
> You would need to add a delay and reverse the hilite before continuing with
> The click command simulates user physically clicking the button, which
> I believe was the effect that original poster wanted.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode