Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi: I am newbie in using Tk and I need to use a multiline field to ask informations for my users in a form. How can I do it? Thanks in Advance, Eustáquio.

Edit kudra, 2001-10-30 Changed title

Replies are listed 'Best First'.
(bbfu) (Tk::Text) Re: Help with Tk
by bbfu (Curate) on Oct 18, 2001 at 20:36 UTC

    Check out Tk::Text.

    Update: An example to get you started:

    #!/usr/bin/perl -w use Tk; use Tk::Text; my $mw = MainWindow->new(-name => 'test'); my $text = $mw->Text(); my $txt = "This is some\ntest text."; # # Insert some text. The first arg is an index # (it can be any of: qw(line.char end linestart lineend # wordstart wordend) and several others) and # the second arg is the text to insert. # $text->insert('0.0', $txt); # Place it in the window $text->pack(); MainLoop; # # And to get the modified text later... # #my $new_text = $text->get('0.0', 'end');

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.