focused object

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

focused object

Post by teacherguy » Sat Jan 07, 2012 12:01 am

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

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: focused object

Post by sturgis » Sat Jan 07, 2012 3:23 am

You can either focus on another object in script or "focus on nothing"

Sounds like focus on nothing is what you're looking for.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: focused object

Post by teacherguy » Sat Jan 07, 2012 3:53 am

Thanks. So if I'm hiding an object, I would follow that with "focus on nothing" in the next line?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: focused object

Post by sturgis » Sat Jan 07, 2012 3:57 am

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.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: focused object

Post by teacherguy » Sat Jan 07, 2012 4:13 am

Thanks. BTW, is focus on "nothing" the same as the selected object being the card?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: focused object

Post by sturgis » Sat Jan 07, 2012 4:20 am

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.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: focused object

Post by teacherguy » Sat Jan 07, 2012 4:27 am

Thanks. Sometimes I wish I could "focus on nothing" you know? :shock:

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: focused object

Post by sturgis » Sat Jan 07, 2012 4:36 am

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.

Post Reply