Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^10: Tk::Entry and double-Tab key weirdness

by atreyu (Sexton)
on Jun 04, 2012 at 15:53 UTC ( [id://974319]=note: print w/replies, xml ) Need Help??


in reply to Re^9: Tk::Entry and double-Tab key weirdness
in thread Tk::Entry and double-Tab key weirdness

Instead of eventGenerate, maybe try looping thru all Entries using $entry->focusForce?

i tried that before, to no avail - at least the way I implemented it:

for(1..(scalar keys %entries)){ # $mw->eventGenerate('<Tab>'); $entries{$_}{'entry'}->focusForce; $mw->eventGenerate('<KeyRelease>'); # $mw->idletasks; $mw->after(100); $mw->update; }
It will force the focus thru all 6 fields, to be sure, and will highlight bad input entries, but will not halt the tab on the first (or any) failed input field.

Try this code:

thanks for that (your tab ordering code), i will test it.

Monks usually look thru the Notes section, below SOPW, and see if there is a reply which they are interested in. Maybe Perlmonks could do a Facebook-like hack and charge $2 bucks to keep your reply to the top of the list. :-)

hah! thanks for the heads up. i do love this forum, but i do not love the interface. i usually depend on a "perlmonks <question>" google search more than using the actual website. but it is good to know the M.O. of the monks.

Your best bet to get more monks to look at your problem, especially after making major code modifications, is to post a new SOPW node, and mention this node as a reference. I mentioned that entry validation is very hard to deal with correctly, and your code now has become quite complex. That probably scares off the casual monk. You should try to make smaller examples which only demonstrate one of the glitches you are running into, if you want more viewers.

yes, you're right, of course. btw, i included the whole code as a reference, in case anybody else was wanting to do something like this (has helped me in the past when others have done so).

P.S. As I was considering all your difficulties, and musing how I might tackle it, I came up with an idea which may help you. Instead of relying totally on the validated entry widget to hold all the correct entry data, why not put a parallel set of read-only Entry widgets( or properly packed set of Label widgets ) aligned right on top of your current widget set. The idea would be that as valid entry text is detected, the corresponding Label would change, and you would be focused to the next invalid Label and it's corresponding validation Entry widget. You would put all your -textvariable data into the Labels, and test them for validity with your own routine, and change bg color for each invalid value. Then you would use the validation Entries solely for entering values to be placed in the Labels, if valid. The user would know they are done, when all the Labels have white background instead of hotpink. :-)

That's not a bad idea...i'll consider that. Thanks for all you help and suggestions, and sticking w/my tedious problems, zentara!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://974319]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-18 18:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found