Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Tcl::Tk listbox error

by GrandFather (Saint)
on Feb 09, 2017 at 07:23 UTC ( [id://1181487]=note: print w/replies, xml ) Need Help??


in reply to Tcl::Tk listbox error

It would help if you provided enough code to actually run and demonstrate the problem. Given code demonstrating the problem it would also help to show the full error message - at... doesn't give much context for the error!

I notice that cpan testers don't show many passing combinations of OS and Perl version for the module (see http://matrix.cpantesters.org/?dist=Tcl-Tk+1.04). You may be better working with an alternative version of Tk? Tk is fairly commonly available and does better with the testers (http://matrix.cpantesters.org/?dist=Tk%20804.033).

Premature optimization is the root of all job security

Replies are listed 'Best First'.
Re^2: Tcl::Tk listbox error
by GrandFather (Saint) on Feb 09, 2017 at 07:56 UTC

    I was interested to see how much I needed to change the supplied code to get something running with Tk

    use strict; use warnings; use Tk; my @cursors = qw/ 12 24 48 96/; my $mw = new MainWindow; my $lb = $mw->Listbox(-selectmode => 'single', ); $lb->pack(-side => 'left', -fill => 'both'); $lb->insert('end', sort @cursors); $lb->bind('<Button-1>', sub { $mw->configure(-background => $lb->get($lb->curselection)); + }); $lb->grid( -row => 10, -column => 2, -columnspan => 1); MainLoop();

    Turns out, two lines - initialise $mw and call MainLoop(). The code executes without error and shows a main window containing a list.

    Premature optimization is the root of all job security
Re^2: Tcl::Tk listbox error
by Anonymous Monk on Feb 09, 2017 at 07:30 UTC

    I notice that cpan testers don't show many passing combinations of OS and Perl version for the module ...

    Yup, an actual tcl installation is a prerequisite, and most cpan-testers dont have tcl installed, thats how it goes

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-18 15:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found