multiline text cell with wrap and enter in wx.grid?

mlgrid.py (1.38 KB)

David A. Barrett wrote:

------------------------------------------------------------------------

#!/usr/bin/env python
#
# wxpython: multiline text cell with wrap and enter in wx.grid?
#
# I would like to have a multiline text cell in a grid that
# behaves in a manner similar to a multi-line text control.
# In particular, that wraps lines to fit the cell

Your sample is only half-way there. You are using the GridCellAutoWrapStringEditor for editing cell content, and you should also use GridCellAutoWrapStringRenderer for displaying the cell content when the editor is not active.

# and that inserts an explict line break when the return key is pressed.

Try Ctrl-Enter. The (plain) Enter key is used by the grid for moving to the next cell down.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!