Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Question regarding focus and Tk

by bmcatt (Friar)
on May 02, 2002 at 20:00 UTC ( #163656=note: print w/replies, xml ) Need Help??

in reply to Question regarding focus and Tk

Untested, but I've used similar in real programs:
It looks like the problem is that you're basing your Checkbutton's state on $state instead of \$state.

What you've got there is setting -state to the current value of $state. You probably want to try using:

my $i = $frame1->Checkbutton(..., -state => \$state, ...);

If that doesn't work, you'll need to get fancier and dynamically adjust the state of your Checkbutton with something like the following:

sub setting { $i->configure(-state => (substr($regex, 0, 2) eq 'tr' ? 'disabled' : 'normal' )); }

Note: The above isn't use strict; compliant. To do that, you can just hand a closure coderef that has the right context to your Entry widget, but doing so is left as an exercise to the reader. :-)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2022-01-21 20:52 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (59 votes). Check out past polls.