Re: Tk::HList oddity
Todd Littlefield <[email protected]> Sat, 17 Jun 2006 11:31:26 -0500
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
I haven't tried this under Linux but with ActiveState 5.8.8-817 it works
fine.
The "Double..." message appears with cols_work and cols_no_work. In the
past, I haven't had any problems with the HList widget on Linux...
As a separate pet peeve, why does the Browse command get called on MouseDown
as well as MouseUp? Shouldn't the browse functionality only happen on
the Up event?
And as a follow up, is there anyway to configure the DoubleClick timeout
under Tk?
If the user clicks twice within the timeout period, the I'd prefer the
browsecmd not to
happen and the command sub get called...
I've tried looking at the widget options, X, etc. and didn't see
anything that matched. I
suppose I could avoid the convenience functions and just look at the raw
events myself
(MouseUp, Double-1, etc.) but I'm a lazy programmer ;-)
Sorry I couldn't help with the original problem and thanks for any
assistance on the
subsequent issues :-)
Sean Kamath wrote:
> Hi all,
>
> OK, here at work we've just run into a little bug with Tk::HList.
>
> I've got a test case and everything.
>
> If you comment out the line
>
> my $cols = $cols_no_work;
>
> (so that $cols is 5, or "$cold_work"), you'll see the "correct"
> behaviour (that is, clicking will produce "Browsing....", and double
> clicking will product "Double....".). Put it back or leave it in, and
> you'll never see anything but "Browsing....".
>
> perl 5.8.8 (and 5.8.6)
> RHEL WS4U3 (and others)
> $Tk::version = '8.4';
> $Tk::VERSION = '804.027';
>
> Any hints, suggestions, etc?
>
> Sean
>
> Here's the test code.
>
> #!/usr/local/bin/perl
>
> use Tk;
> use Tk::HList;
>
>
> my $cols_work = 5;
> my $cols_no_work = 6;
>
> # Set $cols = $cols_no_work to see this break.
>
> my $cols = $cols_work;
> my $cols = $cols_no_work;
>
> my $win = new MainWindow;
> my $hlist = $win->HList(
> -header => 1,
> -columns => $cols,
> -browsecmd => sub { print STDERR "Browsing....\n" },
> -command => sub { print STDERR "Double....\n" }
> )->pack(
> );
> for ( my $hdr=0;$hdr<$cols;$hdr++ ) {
> $hlist->headerCreate( $hdr,
> -itemtype => window,
> -widget => $hlist->Label(-text => "header $hdr")
> );
> }
>
> $hlist->add("test");
> $hlist->itemCreate( "test", 0, -text => "Testing" );
> MainLoop();
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing list
> server. If you wish to unsubscribe from this mailing list, send the
> message body of "unsubscribe ptk" to [email protected]
>
>
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]