Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
All I want to do is keep track of certain elemtnts I'm inserting into my text, and at some point insert more text below the appropriate mark.
I'm using the following code as my trial, and I'm trying to insert "Foo" below Second
Can anyone help?#!usr/bin/perl use warnings; use strict; use Tk; use Tk::Text; use vars qw($text); &init_ui; $text->insert('0.0', "First\n"); $text->insert('end', "Second\n"); $text->insert('end', "Third\n"); $text->markSet("Foo"); ## Not sure about this MainLoop; sub init_ui { my $mw = MainWindow->new( -title => 'Mark in Text ??'); $mw->resizable(0,0); $text = $mw->Scrolled(qw/Text -relief sunken -borderwidth 2 -height 12 -width 35 -wrap word -scrollbars e/ )->pack(-side => 'top'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using mark in Tk::Text
by traveler (Parson) on Apr 14, 2003 at 16:31 UTC | |
by Anonymous Monk on Apr 14, 2003 at 17:34 UTC | |
by traveler (Parson) on Apr 14, 2003 at 20:16 UTC |