Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tk::Text 1

Status
Not open for further replies.

Cagliostro

Programmer
Sep 13, 2000
4,226
GB
Hi, how can I simply get all the text from the text box?

this is a sample:

Code:
#!/usr/local/bin/perl -w 
use Tk; 
$mw = MainWindow->new; 
$text = $mw->Text(-width => 40, -height => 10);
$text->pack; 
MainLoop;

Someone suggested me to do like this:
Code:
print $text->cget('-text');
but I get an error what the -text attribute does not exist.

Now I'm doing something like this:
Code:
$text->get('1.0', '100000.10000');
and I get a text with trailing extra new lines, which I have to trim.

So, how can I simply get only the text entered by the user, with no tags, no ranges and no abrakadabras?

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top