Resizing a column with an expandable wx.Choice control in a cell is
rendered incorrectly and causes the application to enter an infinite
loop. Consider the following code:
import sys
import wx
import wx.lib.agw.ultimatelistctrl as ulc
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY)
self._list = ulc.UltimateListCtrl(self, wx.ID_ANY,
agwStyle=wx.LC_REPORT|wx.BORDER_NONE|wx.LC_VRULES|
wx.LC_HRULES|wx.LC_SINGLE_SEL)
self._list.InsertColumn(0, "Column 1")
self._list.InsertColumn(1, "Column 2")
index = self._list.InsertStringItem(sys.maxint, "a")
self._list.SetStringItem(index, 1, "b")
index = self._list.InsertStringItem(sys.maxint, "c")
self._list.SetStringItem(index, 1, "d")
choice = wx.Choice(self._list, wx.ID_ANY, choices=["one",
"two"])
index = self._list.InsertStringItem(sys.maxint, "e")
### Problem here?
self._list.SetItemWindow(index, 1, choice, expand=True)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self._list, 1, wx.EXPAND)
self.SetSizer(sizer)
app = wx.App()
frame = MyFrame()
frame.Show()
app.MainLoop()
If I set expand=False the list works as expected. That is, if I change
self._list.SetItemWindow(index, 1, choice, expand=True)
to
self._list.SetItemWindow(index, 1, choice, expand=True)
Am I missing something?
I'm running wxPython 2.8.11.0 on Python 2.6.6 on Windows XP.
Caleb