Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • wx.ListCtrl label editting problem

    0 answers - 1686 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Aha! That fixed the problem I was having where the TreeCtrl was not
    returning the correct label text after being edited. Beautiful!
    Ron Griswold
    Character TD
    R!T Pictures
    rgriswold (AT) rioting (DOT) com
    Message
    From: jiwu liu [mailto:liujiwu (AT) msu (DOT) edu]
    Sent: Thursday, November 17, 2005 8:37 AM
    To: wxPython-users (AT) lists (DOT) wxwidgets.org
    Subject: Re: [wxPython-users] wx.ListCtrl label editting problem
    Thanks.
    It worked with wx.CallAfter() like below. I simply moved all my
    code in
    EventHandler "ItemEdited" to a separate function and call this
    function
    after.
    def onItemEdited(self, event): # wxGlade:
    ServerPanel.<event_handler>
    if event.IsEditCancelled():
    return
    newname = event.GetText()
    item = event.m_itemIndex
    wx.CallAfter(self._itemEdited, item, newname)
    def _itemEdited(self, item, newname):
    if not self.validate(newname):
    dlg = wx.MessageDialog()
    dlg.ShowModal()
    dlg.Destroy()
    self.list.SetItemText(item, selfpreEditText)
    But I wonder if it's the right way or simply a work-around of bug.
    Thursday 17 November 2005 09:27 am, limodou wrote:
    I can't speak for jiwu liu, but listtest.py fails for me on suse
    linux
    9.2, Python 2.4.1, wxPython '2.6.1.0'. The event handler is called,
    and
    sometime after the ShowModal() return, the application dies. (Same
    results for suse linux 9.2, python 2.3.4, wxPython 2.5.2.8u.)
    ~/tmppython listtest.py
    Segmentation fault
    ~/tmp>
    gdb stack debug info follows.
    maybe you should use wx.CallAfter to invoke MessageBox

Re: wx.ListCtrl label editting problem


max 4000 letters.
Your nickname that display:
In order to stop the spam: 5 + 4 =
QUESTION ON "Python"

EMSDN.COM