Focus on nothing not working on Windows? [SOLVED]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Focus on nothing not working on Windows? [SOLVED]
Hi all,
Slight cosmetic issue with 'focus on nothing' on Windows.
I'm building one of my apps on a Mac, but mainly intended to run on Windows.
After a splash stack initialises the main stack, this brings up a login card - i have fields with placeholder text in the username/password fields. This placeholder text disappears when entering the field, so this doesn't show if the field has the focus.
On Mac, i can just run 'focus on nothing' and both fields show their placeholder text.
On Windows, the last field always has the focus, hiding it's placeholder text - which is annoying.
Here's what it's supposed to look like: Any suggestions to not allow any of the fields to get the focus after initialising?
Slight cosmetic issue with 'focus on nothing' on Windows.
I'm building one of my apps on a Mac, but mainly intended to run on Windows.
After a splash stack initialises the main stack, this brings up a login card - i have fields with placeholder text in the username/password fields. This placeholder text disappears when entering the field, so this doesn't show if the field has the focus.
On Mac, i can just run 'focus on nothing' and both fields show their placeholder text.
On Windows, the last field always has the focus, hiding it's placeholder text - which is annoying.
Here's what it's supposed to look like: Any suggestions to not allow any of the fields to get the focus after initialising?
Last edited by stam on Tue Jul 27, 2021 8:17 pm, edited 2 times in total.
Re: Focus on nothing not working on Windows?
Hello,
Here is a sample stack, although it is not exactly like the image, you already have an idea of how to do it.
Hope this helps you.
Here is a sample stack, although it is not exactly like the image, you already have an idea of how to do it.
Hope this helps you.
- Attachments
-
- loginUI.rar
- (1.64 KiB) Downloaded 125 times
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Focus on nothing not working on Windows?
Does "select empty" work any better?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Focus on nothing not working on Windows?
Hope this does help you.
- Attachments
-
- loginUI-1.rar
- (3.68 KiB) Downloaded 106 times
Re: Focus on nothing not working on Windows?
Thanks @andresdt - i must be a bit dense today tho, how does this stop the fields from getting the focus on Windows?
Re: Focus on nothing not working on Windows?
I'll try that when I'm at a windows work machine again - the rate limiting step for me is i don't have an easily accessible Windows machine for testing and in any case cannot replicate the locked down environment at the target machine, so i have build, transfer, test, fail and repeat
getting there though!
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Focus on nothing not working on Windows?
"Focus on nothing" is not intended to be an executable statement in a script. It's a reminder for the scripter. Practiced with earnestness, it can help you transcend any need to worry about trying to make Windows look attractive.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Focus on nothing not working on Windows?
I had to read that twice before I saw what you did there.FourthWorld wrote: ↑Mon Jul 26, 2021 9:19 pm"Focus on nothing" is not intended to be an executable statement in a script. It's a reminder for the scripter. Practiced with earnestness, it can help you transcend any need to worry about trying to make Windows look attractive.
If you had included a big image, I might have thought you were channelling Richmond.
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Focus on nothing not working on Windows?
One more possibility: It's a result of LC's (irritating) auto-select of the first editable field when a card opens. If your password field is the first-layered one then that could be what's happening, though in theory it should do the same thing on Mac too. The workaround is to turn off traversalOn in preOpenCard and turn it back on using a "send" command after openCard finishes.
This probably isn't the reason since it doesn't happen on Mac, but maybe the workaround will fix it anyway. Another Windows-only workaround is to put a button at a lower level than the fields. On Windows, buttons can have traversalOn and the button would get the selection instead of the field.
This probably isn't the reason since it doesn't happen on Mac, but maybe the workaround will fix it anyway. Another Windows-only workaround is to put a button at a lower level than the fields. On Windows, buttons can have traversalOn and the button would get the selection instead of the field.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Focus on nothing not working on Windows?
Just for the record is tested working on Windows here, using a basic stack.
I am not sure what is going on in the OP's stack, but it shouldn't need jiggery-pokery to work, but then there's jiggery-pokery going on with the placeholder text construction.
Code: Select all
focus on nothing
I am not sure what is going on in the OP's stack, but it shouldn't need jiggery-pokery to work, but then there's jiggery-pokery going on with the placeholder text construction.
Last edited by SparkOut on Mon Jul 26, 2021 10:14 pm, edited 1 time in total.
Re: Focus on nothing not working on Windows?
Apparently I need to sleep!
I don't know if I understand your problem.
what you want is that when entering the login card the username field is selected?
If that's, you can do like this:
then in the username field you can put:
I don't know if I understand your problem.
what you want is that when entering the login card the username field is selected?
If that's, you can do like this:
Code: Select all
on openCard
focus on field "username" of me
end openCard
Code: Select all
on enterInField
focus on field "password" of this card
end enterInField
on returnInField
enterInField
end returnInField
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Focus on nothing not working on Windows?
Not exactly. When the card opens he wants nothing selected. LC auto-selects the first editable field and if that's what's happening then it's interfering with the default hint text for that field. There may be a timing issue involved.
If none of the suggestions here work, I think I'd send a specific command to show hint text after the card opens.
If none of the suggestions here work, I think I'd send a specific command to show hint text after the card opens.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Focus on nothing not working on Windows?
Thanks @jacque
Timing was probably the issue in the standalone.
I have a card handler does some init stuff for the login fields and ends with 'focus on nothing'. I call this directly at the end of openStack. In the IDE this works fine but on the Win stand alone it didn't, leaving the focus on a field and spoiling the placeholder text effect.
This is what it's supposed to look like This is what actually happened no matter what the code Just annoying enough
Taking a cue from Jacque's suggestion, Instead of call the handler directly, i tried using and it works fine.
Well, fine-ish, as there is a quick flash where the field does get the focus but at this point i'll live with that.
Thanks all!
Timing was probably the issue in the standalone.
I have a card handler does some init stuff for the login fields and ends with 'focus on nothing'. I call this directly at the end of openStack. In the IDE this works fine but on the Win stand alone it didn't, leaving the focus on a field and spoiling the placeholder text effect.
This is what it's supposed to look like This is what actually happened no matter what the code Just annoying enough
Taking a cue from Jacque's suggestion, Instead of call the handler directly, i tried using
Code: Select all
send <init-handler> to me in 0.5 seconds
Well, fine-ish, as there is a quick flash where the field does get the focus but at this point i'll live with that.
Thanks all!
Last edited by stam on Wed Jul 28, 2021 8:24 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Focus on nothing not working on Windows? [SOLVED]
Stam, is that for Mayo?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 7237
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Focus on nothing not working on Windows? [SOLVED]
I wonder if a lockscreen would overcome the flash.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com