Redirecting focus away from a field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
see3d
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 15
Joined: Tue Apr 11, 2006 12:07 am

Redirecting focus away from a field

Post by see3d »

I feel like a newbie again after 10 years away from LC...lol
I have a field that has the focus. When I click on some button, I want to close the field (remove the focus). I am having a hard time figuring out how to do this other than manually clicking into another field. None of my experiments have worked and a search here did not turn up anything. I must be missing something so basic that it is too obvious to be mentioned. :?
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Redirecting focus away from a field

Post by bogs »

In the button's script, either in mouseDown or up, wouldn't

Code: Select all

focus on nothing
work? Or

Code: Select all

focus on {control}
Image
[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Redirecting focus away from a field

Post by [-hh] »

in the button's script add the line

Code: Select all

select empty
shiftLock happens
see3d
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 15
Joined: Tue Apr 11, 2006 12:07 am

Re: Redirecting focus away from a field

Post by see3d »

bogs wrote: Fri Mar 01, 2019 10:01 pm In the button's script, either in mouseDown or up, wouldn't

Code: Select all

focus on nothing
Thank you. There you go, see I am a newbie all over again. I could not find that focus on command when I looked before (I can find it easy now). My eyes must be getting old... :shock:
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Redirecting focus away from a field

Post by bogs »

see3d wrote: Fri Mar 01, 2019 10:22 pm Thank you. There you go, see I am a newbie all over again. I could not find that focus on command when I looked before (I can find it easy now). My eyes must be getting old...
Heh, I feel like that just about every day, believe me your more than welcome any time 2 of my brain cells fire to the beneficial side :D
Image
Post Reply