directEntry will not loose focus

How do you loose focus? The only way I can find is to click enter. I want to click off the Entry GUI with the mouse or maybe press tab and loose focus. How can I do this?
Thanks!

Have you tried:

entry['focus'] = False

?

David

I could trap the event and then do the set entry[‘focus’] = False but should not the gui system do this by itself? It gets focus by itself when you click on it but when you click off it, it does not loose it. The only way to loose focus is to press enter. Are you saying that there is no other way for the DirectEntry to loose focus but the enter button?
Thanks

Oh, I thought you were asking for a way to programmatically lose focus.

The entry loses focus when you click on something else that can receive focus. The background window doesn’t normally receive focus, so that’s why focus doesn’t go away when you click on the background window. But you could create a gui widget (for instance, a blank DirectLabel) that fills the entire window, to receive focus when you click on the background. Or, you can listen for the mouse event and call the method yourself.

David

DirectLabel does not take focus ether, I think but maybe a clear button will do the job. I have not heard back from you on the other thread, still lost with the time stuff. Smooth will work a bit if I just use local time for everything but that is obviously not the way.

I think DirectLabel will take focus if you declare it active. (DirectLabels are inactive by default.) But you’re right, a button will also do the trick. Rather than making it clear, you could simply make it have no geometry at all, and set the frame to cover the screen explicitly–this will avoid having to draw a transparent polygon that covers the screen.

David