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

In particular I'm having problems passing the @array to the subroutine.

Considering that your 222 line blob of code contains 12 subroutines, but no mentioning of "@array", your question is very mysterious. I guess you have somewhere in your 222 lines something you have problems with. But while posting code is good, posting a complete 222 line program without any indication where your problem is, is not a good idea.

You said you wanted to put text typed in my the user directly on the canvas, but how you want to do that is unclear to me. I've looked for the bindings, but all you seem to bind are mouse related events.

Abigail

  • Comment on Re: How to put text on the canvas for a keyboard STDIN

Replies are listed 'Best First'.
Re: Re: How to put text on the canvas for a keyboard STDIN
by Anonymous Monk on Sep 15, 2003 at 18:19 UTC
    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