Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: TK binding

by bbfu (Curate)
on Apr 08, 2004 at 22:58 UTC ( #343793=note: print w/ replies, xml ) Need Help??


in reply to TK binding

Have a binding for ButtonPress that sets a flag variable, as well as one for ButtonRelease that clears the flag. Then, have a binding for Motion that returns immediately if the flag is not set, otherwise processes the event normally. Something like:

my $flag = 0; $cnv_reference_ref->bind("location$x", '<B1-ButtonPress>' => [sub { $f +lag = 1 }, "$i", "1"]); $cnv_reference_ref->bind("location$x", '<B1-ButtonRelease>' => [sub { +$flag = 0 }, "$i", "1"]); $cnv_reference_ref->bind("location$x", '<B1-Motion>' => [sub { return +unless $flag; click_select(@_) }, "$i", "1"]);

bbfu
Black flowers blossom
Fearless on my breath


Comment on Re: TK binding
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2015-07-04 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls