Heres another double click demo:
#!/usr/bin/perl use strict; use Tk; my ( $clickedon, $released, $double ); my $mw = tkinit; my $lb = $mw->Scrolled( 'Listbox', -scrollbars => 'osoe' )->pack; $lb->insert( 0, 'A' .. 'Z' ); $lb->bind( '<ButtonPress-1>', sub { $clickedon = $lb->get( $lb->curselection ); } ); $lb->bind( '<ButtonRelease-1>', sub { $released = $lb->get( $lb->curselection ); } ); $lb->bind( '<Double-1>', sub { $double = $lb->get( $lb->curselection ) +; } ); my $f1 = $mw->Frame->pack( -anchor => 'w' ); $f1->Label( -text => 'Clicked on: ' )->pack( -side => 'left' ) +; $f1->Label( -textvariable => \$clickedon )->pack( -side => 'left' ) +; my $f2 = $mw->Frame->pack( -anchor => 'w' ); $f2->Label( -text => 'Released on: ' )->pack( -side => 'left' +); $f2->Label( -textvariable => \$released )->pack( -side => 'left' +); my $f3 = $mw->Frame->pack( -anchor => 'w' ); $f3->Label( -text => 'Double Clicked: ' )->pack( -side => 'lef +t' ); $f3->Label( -textvariable => \$double )->pack( -side => 'lef +t' ); MainLoop;

I'm not really a human, but I play one on earth. flash japh

In reply to Re: Tk event bindings - single vs. double click by zentara
in thread Tk event bindings - single vs. double click by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.