Search code examples
pythonwxpythonwxwidgets

How can I make wxTextCtrls in a FlexGridSizer all be 'x' lines high?


I have an array, of unknown length, of key:val pairs. Each pair occupies a row in a FlexGridSizer. The keys are in the first column, as wx.StaticTexts, and the vals are in the second column, as wx.TextCtrls.

The problem is that there isn't a lot of room available, and some of the vals are relatively long, and don't fit in the wx.TextCtrls. I would like to have all of the wx.TextCtrls be maybe 2 or 3 lines in height.

I've tried using style = wx.TE_MULTILINE, but that just adds a vertical scrollbar, as opposed to the default behaviour of scrolling horizontally with left/right/home/end etc.

Any ideas?


Solution

  • I ended up using FlexGridSizer. I made each of the val cells span across two rows, and added empty wx.Size()s below each key. The result is something like this:

    Grid