Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

RE: Re: Tk - text widget - delete text

by softeng2000 (Novice)
on Oct 03, 2000 at 22:03 UTC ( [id://35159]=note: print w/replies, xml ) Need Help??


in reply to Re: Tk - text widget - delete text
in thread Tk - text widget - delete text

Thank you for reply
Although, I get this:

Tk::Error: bad text index "0" at C:/Perl/site/lib/Tk.pm line 217.
Tk callback for .frame11.frame.text
Tk::__ANON__ at C:/Perl/site/lib/Tk.pm line 217
Tk::Derived::Delegate at C:/Perl/site/lib/Tk/Derived.pm line 469
Tk::Widget::__ANON__ at C:/Perl/site/lib/Tk/Widget.pm line 311
main::ClearList_Button at C:\Valeriy\Perl\Spiders\WebCrawler\WC3\WC33.PL line 2 14
main::__ANON__ at C:\Valeriy\Perl\Spiders\WebCrawler\WC3\WC33.PL line 105
\&main::__ANON__
Tk callback for .frame10.button
Tk::__ANON__ at C:/Perl/site/lib/Tk.pm line 217
Tk::Button::butUp at C:/Perl/site/lib/Tk/Button.pm line 111 (command bound to event)

Replies are listed 'Best First'.
RE: RE: Re: Tk - text widget - delete text
by Shendal (Hermit) on Oct 03, 2000 at 22:54 UTC
    Here's a more complete example:
    #!perl -w use strict; # always use Tk; my $Window = MainWindow->new(-title => "Test Window"); my $uframe =$Window->Frame() ->pack(-side => 'top', -fill => 'both', -expand => 1); my $dframe =$Window->Frame() ->pack(-side =>'top', -fill => 'x'); my $txtWidget = $uframe->Scrolled("Text") ->pack(-side => 'top', -fill => 'both', -expand => 1); my $pasteBtn = $dframe->Button(-text => "Paste", -command => sub { $txtWidget->insert('end',"blah b +lah") }) ->pack(-side => 'left'); my $clearBtn = $dframe->Button(-text => "Clear", -command => sub { $txtWidget->delete('0.0','end') } +) ->pack(-side => 'left'); MainLoop();

    Cheers,
    Shendal

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://35159]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-25 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found