Donkyhotay / pgu

Automatically exported from code.google.com/p/pgu
GNU Lesser General Public License v2.1
0 stars 0 forks source link

gui.textarea.TextArea blows up when value="" #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
    t = gui.Table()
    t.tr(gui.TextArea(value=''))
2. Click in text area. Get IndexError somewhere in setCursorByXY() or 
setCursorByHVPos(). Can't remember exactly where, but I'm including the trivial 
fix for you at the end of this. :)

What is the expected output? What do you see instead?
Should focus the textarea and allow typing. Instead it raises IndexError.

What version of the product are you using? On what operating system?
pgu 0.14, pygame 1.9.1, Python 2.6.6, Windows 7.

Please provide any additional information below.
In file pgu/gui/textarea.py, TextArea.doLines() make the following addition:
            # If we reached the end of our text
            if (inx < 0):
                # Then make sure we added the last of the line
                if (line_start < len( self.value ) ):
                    self.lines.append( self.value[ line_start : len( self.value ) ] )
                ## ADD: next 2 lines
                else:
                    self.lines.append('')

Original issue reported on code.google.com by stabbing...@gmail.com on 28 Jan 2011 at 3:31

GoogleCodeExporter commented 9 years ago
Closing this ticket since you've included this change in a recent patch. Thanks!

Original comment by peter.ro...@gmail.com on 6 Mar 2011 at 9:36