in reply to Re: How to put text on the canvas for a keyboard STDIN
in thread How to put text on the canvas for a keyboard STDIN

Abigail-II,

I didn't mean to waste your time. I actually have a problem passing @range not @array. Basically I'm a biologist who inhereted the code and needs to try and do something with it. I'm a really bad programmer (in Perl) and don't even know how to a bind keyboard event.

The problem area in the code is here (line 212):
my ($what) = @_; my $what_val = $what->get; # use get to access contents + of entry $canvas ->createText($range[0],$range[1], -text=>"$what_val\n");

I'm using this to put some text on the canvas but can't pass the @range so I can't get $range[0] & $range 1.

If I can skip the sub all together and bind the keyboard here (line 121)
elsif ($drawItem eq "text"){ my $main = MainWindow->new; $main->Label(-text => 'Annotation Entry')->pack; # create an annot +ation label and pack it my $say = $main->Entry(-width => 100); $say->pack; $main->Button(-text => 'Enter', -command => sub{do_say($say)} )->pack;
without needing to call the sub, that would be great!
Thanks in advance for any help and sorry I wasn't clear the first time.
-Mark