On Fri, 5 Apr 2002 16:59:00 -0800 , [EMAIL PROTECTED] (Timothy Johnson)
wrote:
>
>Hey, is there anybody out there than can give me a really short example of
>retrieving text from an Entry box? I see in the documentation that you use
>the $entry-gtget, but there aren't any syntax examples.
>
>What I have so far:
>
>use tk;
>my $main = MainWindow->new();
>$main->minsize(100,100);
>$main->configure( -background => 'white' );
>my $frame = $main->Frame()->pack( -fill => 'both' );
>my $entry = $frame->Entry()->pack( -side => 'left' );
>$entry->insert(0,'Default Text');
>
>???
>
>Drawing a window isn't very useful if I can't get information back from it.
>
#!/usr/bin/perl
use Tk;
$mw=tkinit;
$t=$mw->Text->pack;
$t->insert('end',"This is some\ntext to retrieve");
$mw->Button(-text=>'Print Text',
-command=>sub{
print $t->get('1.0','end'),"\n"}
)->pack(-fill=>'x');
MainLoop;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]