ttlgreen has asked for the wisdom of the Perl Monks concerning the following question:
I finally got around to attempting to learn how to use perl/tk.
I keep getting this error:
no event type or button # or keysym at /usr/lib64/perl5/vendor_perl/5. +8.8/x86_64-linux-thread-multi/Tk/Widget.pm line 1105. at ./ThreadFeed.pl line 16
I started out with the tutorial right here in the temple at http://perlmonks.org/?node_id=181977 and running the "sigeval.pl" I get that error at line 58 of sigeval.pl
I tried running some example code from another tutorial I found on google which produced that error on this line (line 16 of ThreadFeed.pl): my $txt = $textarea -> Text(-width=>40, -height=>10);
I recently rebuilt perl with the "ithreads" support and I also rebuilt the TK module and a few others just in case.
I've searched everywhere and found a couple mentions of this problem on google but no solutions/explanations. Can anybody shed some light on this?
Thanks!
Here is the "ThreadFeed.pl" file, It is just some example code from the tutorial I found, un-altered.
#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = new MainWindow; # Main Window my $frm_name = $mw -> Frame(); my $lab = $frm_name -> Label(-text=>"Name:"); my $ent = $frm_name -> Entry(); my $but = $mw -> Button(-text=>"Push Me", -command =>\&push_button); my $textarea = $mw -> Frame(); #Creating Another Frame my $txt = $textarea -> Text(-width=>40, -height=>10); my $srl_y = $textarea -> Scrollbar(-orient=>'v',-command=>[yview => $t +xt]); my $srl_x = $textarea -> Scrollbar(-orient=>'h',-command=>[xview => $t +xt]); $txt -> configure(-yscrollcommand=>['set', $srl_y], -xscrollcommand=>['set',$srl_x]); $lab -> grid(-row=>1,-column=>1); $ent -> grid(-row=>1,-column=>2); $frm_name -> grid(-row=>1,-column=>1,-columnspan=>2); $but -> grid(-row=>4,-column=>1,-columnspan=>2); $txt -> grid(-row=>1,-column=>1); $srl_y -> grid(-row=>1,-column=>2,-sticky=>"ns"); $srl_x -> grid(-row=>2,-column=>1,-sticky=>"ew"); $textarea -> grid(-row=>5,-column=>1,-columnspan=>2); MainLoop; #This function will be executed when the button is pushed sub push_button { my $name = $ent -> get(); $txt -> insert('end',"Hello, $name."); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl/tk error I can't figure out
by bcrowell2 (Friar) on Feb 01, 2009 at 02:16 UTC | |
by ttlgreen (Sexton) on Feb 01, 2009 at 03:00 UTC | |
by smallpond (Initiate) on Nov 16, 2014 at 14:50 UTC | |
|
Re: Perl/tk error I can't figure out
by zentara (Cardinal) on Feb 01, 2009 at 15:22 UTC | |
by ttlgreen (Sexton) on Feb 01, 2009 at 21:19 UTC | |
by zentara (Cardinal) on Feb 02, 2009 at 14:05 UTC | |
|
Re: Perl/tk error I can't figure out
by boblawblah (Scribe) on Feb 01, 2009 at 16:32 UTC | |
by ttlgreen (Sexton) on Feb 01, 2009 at 21:32 UTC |