Page 1 of 1
focused object
Posted: Sat Jan 07, 2012 12:01 am
by teacherguy
This issue gave me fits for hours today until I saw this:
What's new in LiveCode 5.0.1.1466:
November 25th, 2011
ยท Focus not revoked when object hidden using 'hide ... with visual effect'.
Can anyone tell me how to force the object to give up the focus?
Thanks,
Brian
Re: focused object
Posted: Sat Jan 07, 2012 3:23 am
by sturgis
You can either focus on another object in script or "focus on nothing"
Sounds like focus on nothing is what you're looking for.
Re: focused object
Posted: Sat Jan 07, 2012 3:53 am
by teacherguy
Thanks. So if I'm hiding an object, I would follow that with "focus on nothing" in the next line?
Re: focused object
Posted: Sat Jan 07, 2012 3:57 am
by sturgis
yep. should remove focus from all objects. I don't know how hiding with affects works though, so theres always a chance of weirdness. If it doesn't work as expected give a shout.
Re: focused object
Posted: Sat Jan 07, 2012 4:13 am
by teacherguy
Thanks. BTW, is focus on "nothing" the same as the selected object being the card?
Re: focused object
Posted: Sat Jan 07, 2012 4:20 am
by sturgis
Hmm Good question. Just did a quick test. Set up a button with script
on mouseUp
focus on nothing
put the focusedobject
end mouseup
Then had a field with an insertion point. Click button, insertion point leaves and yes indeed, the info for the current card is put into the msg box. So yep. Looks like your guess is correct.
Re: focused object
Posted: Sat Jan 07, 2012 4:27 am
by teacherguy
Thanks. Sometimes I wish I could "focus on nothing" you know?

Re: focused object
Posted: Sat Jan 07, 2012 4:36 am
by sturgis
yeah would be nice. instead I focus on this, or that, or the other thing. And when I try to focus on nothing the very act of trying contradicts the possibility of success!
So instead I focus on my toes. They wiggle nicely.