in reply to difficulty inserting at line and character col in tkx text widget

I forget a $my but the problem still remains
use Tkx; $mw=Tkx::widget->new("."); my $text = $mw->new_tk__text(-width => 50, -height => 50); $text->g_pack( -expand => 1, -fill => 'both', ); $text->insert("5.10", "testing"); Tkx::MainLoop();
  • Comment on Re: difficulty inserting at line and character col in tkx text widget
  • Download Code

Replies are listed 'Best First'.
Re^2: difficulty inserting at line and character col in tkx text widget
by previous (Sexton) on Jan 24, 2016 at 18:01 UTC
    Ok...I got it to "work" but only after I'd filled sufficient lines SEQUENTIALLY using $text->insert("end", $some_text."\n"); I was then able to insert stuff at the specified line and column.

      Now that you found out anyway, I can see it in the documentation, too :-)

      It's a bit cryptic, however.
      If index refers to the end of the text (the character after the last newline) then the new text is inserted just before the last newline instead.
      is probably meant to say
      Trying to insert anywhere after the end of existing text results in simply appending.