Search code examples
perltk

Delete the text widget contents using perl_tk


If we want to remove the entry widget contents we can use delete with entry object.

Example

$ent->delete(0,'end');

But I want to remove the Text widget contents.Can any one tell me what is the function for removing the text widget contents?


Solution

  • use the following way

    use Tk;

    use Tk::Text ;

    .... .....

    my $txt = $mw->Text( -background =>'white', )-> pack ();

    $txt -> delete('1.0','end');

    Refer the Links. http://legacyweb.triumf.ca/people/cpayne/perl/Tk/Text.html>Tk::Text