> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of ????? ???????? > Sent: December 19, 2005 7:48 AM > To: perl-win32-users@listserv.ActiveState.com > Subject: Calling parent's method > > Why is that > > $text_undo = $down_packer1->Scrolled( > 'TextUndo', > -scrollbars => 'osoe', > -height => 20, > -width => 80, > -font => "$text_font $text_size", > -wrap => 'none', > )->pack( > -fill => 'both', > -expand => 1, > -side => 'top', > -pady => 7, > ); > > ... > > $text_undo->Tk::Text::delete('1.0', 'end'); #I need > Tk::Text::delete in order not to disturb UNDO stack > > throws an error: > Tk::Error: bad option "delete": must be cget, or configure at > c:/Perl/site/lib/Tk.pm line 252. > Tk callback for .frame.frame > <Key-Return> > (command bound to event) >
The problem here, is that you don't have the reference to the actual TextUndo widget but to the Tk::Frame housing the TextUndo and the scrollbars (i.e. that is what the "Scrolled" method returns). To get the reference to the TextUndo widget: $real_text_undo = $text_undo->Subwidget('scrolled'); Now the following should work: $real_text_undo->Tk::Text::delete('1.0','end'); Jack PS..I assume you wish to do this because you want to delete something programmatically but not affect the users undo functionality? I hope not. Because you "will" affect the undo functionality. You would be deleting stuff which will likely be in the undo list and then it won't behave as expected. _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs