Possible bug in UltimateListCtrl when using a Window in a cell

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

Try upgrading to the latest ULC code from the SVN repository. It looks like this issue may have been solved already

···

On 10/8/10 7:23 AM, Const wrote:

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:

--
Robin Dunn
Software Craftsman

I downloaded the one from http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/AGW/agw/;
it seems to have the same issue.

Caleb

···

On Oct 8, 3:14 pm, Robin Dunn <ro...@alldunn.com> wrote:

Try upgrading to the latest ULC code from the SVN repository. It looks
like this issue may have been solved already

Hi,

Try upgrading to the latest ULC code from the SVN repository. It looks
like this issue may have been solved already

I downloaded the one from http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/AGW/agw/;
it seems to have the same issue.

Please enter a bug report on wxTrac, specifying "AGW" as the
component. If you could identify where the problem lies (and maybe
provide a patch), it would be most helpful. I am currently on-shift at
work and I won't have much time to look at AGW bugs for the next month
or so, so any help in speeding up the bug-fixing process is very
appreciated.

Thank you.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 8 October 2010 21:17, Const wrote:

On Oct 8, 3:14 pm, Robin Dunn <ro...@alldunn.com> wrote:

Hmm... It probably worked for me because I was using wx 2.9 to test it. In that case it is probably a lower level issue with wxChoice in 2.8 on Windows.

I seem to recall that there was a similar issue a long time ago with using a Choice or ComboBox on an HtmlWindow. The work-around then was to put the wx.Choice on a wx.Panel and then use the panel as the widget in the HtmlWindow. You may want to give that a try.

···

On 10/8/10 11:17 AM, Const wrote:

On Oct 8, 3:14 pm, Robin Dunn<ro...@alldunn.com> wrote:

Try upgrading to the latest ULC code from the SVN repository. It looks
like this issue may have been solved already

I downloaded the one from http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/AGW/agw/;
it seems to have the same issue.

--
Robin Dunn
Software Craftsman