wxGrid autowrap?

Stumbling through the code of GridSimple.py in the demo, I came across some
intriguing lines that are commented out.

There is, for example, a call to wxGridCellAutoWrapStringRenderer().
"Aha!", I said. "Looks like just what I want." But how does it work?
What does it do? What are the limits?

Not much of a clue. Have I missed this somewhere in the documentation, or
is this yet another of the undocumented features that seem to multiply when
you''re not looking?

More to the point: Suppose I wanted to use this and then: (1) Keep the
width of the cell constant, but (2) have the row containing the cell resize
its height to display the wrapped text?

Any help will be appreciated.

···

--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456

Stumbling through the code of GridSimple.py in the demo, I came across some
intriguing lines that are commented out.

There is, for example, a call to wxGridCellAutoWrapStringRenderer().
"Aha!", I said. "Looks like just what I want." But how does it work?
What does it do? What are the limits?

Not much of a clue. Have I missed this somewhere in the documentation, or
is this yet another of the undocumented features that seem to multiply when
you''re not looking?

Yep. Somebody added several editors and renderers a whle back, but like the rest of wxGrid the docs are in a poor state or nonexistent. That will change when we start autogenerating our own copy of the docs.

More to the point: Suppose I wanted to use this and then: (1) Keep the
width of the cell constant, but (2) have the row containing the cell resize
its height to display the wrapped text?

Looks like it implements a GetBestSize that will do that. It takes the column width and then trys to calculate where to wrap and what the height should be at that width.

···

gary.h.merrill@gsk.com wrote:

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