Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 romping around the Monastery: (10)
As of 2014-07-24 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls