Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: text delete hangs in Perl/Tk

by arden (Curate)
on Jul 01, 2004 at 19:43 UTC ( #371222=note: print w/ replies, xml ) Need Help??


in reply to text delete hangs in Perl/Tk

Your syntax is correct: "$text->delete("1.0", 'end');". Are you sure that your script is hung or might it just be that the amount of text between your indexes is that large ("several thousand lines with as many as ~1000 characters per line")?

Perhaps if you provided us with the block of code around where you think it is hanging it might help. You could be wrong as to the cause. . .

- - arden.
TMI is better than NEI in the tech-help world!


Comment on Re: text delete hangs in Perl/Tk
Download Code
Re^2: text delete hangs in Perl/Tk
by Anonymous Monk on Jul 01, 2004 at 19:58 UTC
    Unfortunately, the call is buried within a couple thousand lines of widget code and it would be difficult to provide a block that would provide enough context.

    My main clue is that if I don't Add the tags to the text, the delete seems to work fine. Is it possible that if I've associated an invalid tag location with the text that it would cause delete to stall? Or perhaps I should be Removing all the tags before I try to delete the text lines with which they are associated? I have been operating under the assumption that the tags just "magically disappear" when you delete the text out from under them...

      It is possible that there is some non-optimized code in the Tk core in some special situations. Can you check if it is faster if you delete the tags (either with tagDelete or tagRemove) before deleting the contents?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-07-23 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (133 votes), past polls