Crashing wxListCtrl (EVT_LIST_END_LABEL_EDIT) (EditLabel?)

The following program crashes when pressing return after typing some
characters in the editing control. It seems only to crash if editing is
initiated by using EditLabel().

from wxPython.wx import *

class MyFrame(wxFrame):
    def __init__(self, parent, id, name):
        wxFrame.__init__(self, parent, id, name)

        listctrl = wxListCtrl(self, -1, size = (200, 200),
                              style = wxLC_REPORT | wxLC_HRULES | wxLC_SINGLE_SEL | wxLC_EDIT_LABELS)
        
        sizer = wxBoxSizer(wxVERTICAL)
        sizer.Add(listctrl, option = 1, flag = wxEXPAND)

        self.SetSizerAndFit(sizer)
        self.Show()

        listctrl.InsertColumn(0, "HEADER")
        listctrl.InsertStringItem(0, "FOO")

        EVT_LIST_BEGIN_LABEL_EDIT(listctrl, -1, self.on_begin_edit)
        EVT_LIST_END_LABEL_EDIT(listctrl, -1, self.on_end_edit)

        listctrl.EditLabel(0)

    def on_begin_edit(self, evt):
        print "BEGIN!"

    def on_end_edit(self, evt):
        print "END!"
    
class MyApp(wxApp):
    def OnInit(self):
        frame = MyFrame(NULL, -1, "Hello from wxPython")
        frame.Show(true)
        self.SetTopWindow(frame)
        return true

app = MyApp(1)
app.MainLoop()

···

--
/Jesper

Jesper Eskilson wrote:

The following program crashes when pressing return after typing some
characters in the editing control. It seems only to crash if editing is
initiated by using EditLabel().

I've submitted a bug report with a bit more info:

https://sourceforge.net/tracker/index.php?func=detail&aid=692526&group_id=9863&atid=109863

···

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

Robin Dunn <robin@alldunn.com> writes:

Jesper Eskilson wrote:
> The following program crashes when pressing return after typing some
> characters in the editing control. It seems only to crash if editing is
> initiated by using EditLabel().

I've submitted a bug report with a bit more info:

https://sourceforge.net/tracker/index.php?func=detail&aid=692526&group_id=9863&atid=109863

Will you have time to look into this?

···

--
/Jesper

Jesper Eskilson wrote:

Robin Dunn <robin@alldunn.com> writes:

Jesper Eskilson wrote:

The following program crashes when pressing return after typing some
characters in the editing control. It seems only to crash if editing is
initiated by using EditLabel().

I've submitted a bug report with a bit more info:

https://sourceforge.net/tracker/index.php?func=detail&aid=692526&group_id=9863&atid=109863

Will you have time to look into this?

It's beyond my time and abilities right now, and will probably have to be done by Vadim or Julian. If you have win32 api skills and can submit a patch then I'll check it in.

···

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