Esteemed Monks,

I am using Perl/Tk and Tk::DBI::Table which as a Tk::HList as part of it. I would like to have an action performed when I double click on an entry in the list, my code looks like this:

# Using the supplied SQL display a table view of the data. sub doDBItable { my ( $dbh, $SQL, $title ) = @_; debug("+doDBItable"); debug("SQL : $SQL"); if ( not defined $title ) { $title = "List Preview" } my $top = MainWindow->new( -title => $title ); $top->geometry("600x400+50+50"); my $tkdbi = $top->DBITable( -sql => $SQL, -dbh => $dbh, -display_id => 1, -debug => 0, )->pack( -expand => 1, -fill => 'both' ); $tkdbi->Subwidget('table')->configure( -selectmode => 'single', -command => \&procSelected, -browsecmd => sub{ printf "This is id: %s\n", $_[0] }, ); debug("-doDBItable"); return $top; } sub procSelected { printf "Process record %s\n", $_[0]; }
When I click on a row the '-browsecmd' code executes, but the '-command' callback only gets called when I select the row then hit enter. According to the Tk::HList docs, and everything I can find written about the HList widget, it should respond to the double-click also.

Any suggestions?

jdtoronto


In reply to Perl/Tk HList double click binding issue by jdtoronto

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.