Hi, I'm new to wxPython, and I've been having an issue when I try to
DeleteAlllItems() from a ULC. I receive this error:
"wx._core.PyDeadObjectError: The C++ part of the Button object has
been deleted, attribute access no longer allowed." Is there a way to
fix this? I have been able to delete all the times if I use
DeleteItem() on every single item individually. Since this is slower
and I don't need the event, I would like to use DeleteAllItems() if
there is a way to get it to work.
I posted a question on StackOverFlow with the same code that applies:
In UltimateListCtrl.py (python26\Lib\site-packages\wx-2.8-msw-unicode
\wx\lib\agw) the function DoDeleteAllItems:
Replace:
for item in self._itemWithWindow:
wnd = item.GetWindow()
wnd.Destroy()
with:
for item in self._itemWithWindow:
if item.GetWindow():
self.DeleteItemWindow(item)
And try it again, I'm guessing it will fix the problem. Backup the
file first before editing it! Then make a report in Trac setting
component AGW: http://trac.wxwidgets.org/ so someone can review it
more closely than I did.
Mark
···
On Sep 2, 5:40 am, Flow of Soul <flow.of.soul...@gmail.com> wrote:
Hi, I'm new to wxPython, and I've been having an issue when I try to
DeleteAlllItems() from a ULC. I receive this error:
"wx._core.PyDeadObjectError: The C++ part of the Button object has
been deleted, attribute access no longer allowed." Is there a way to
fix this? I have been able to delete all the times if I use
DeleteItem() on every single item individually. Since this is slower
and I don't need the event, I would like to use DeleteAllItems() if
there is a way to get it to work.
I posted a question on StackOverFlow with the same code that applies:
In UltimateListCtrl.py (python26\Lib\site-packages\wx-2.8-msw-unicode
\wx\lib\agw) the function DoDeleteAllItems:
Replace:
for item in self._itemWithWindow:
wnd = item.GetWindow()
wnd.Destroy()
with:
for item in self._itemWithWindow:
if item.GetWindow():
self.DeleteItemWindow(item)
And try it again, I'm guessing it will fix the problem. Backup the
file first before editing it! Then make a report in Trac setting
component AGW: http://trac.wxwidgets.org/ so someone can review it
more closely than I did.
Thank you for this, I'll try and update the SVN code when I get back
home. It would be nice to have a ticket for this, though.
Thanks that piece of code, it works great. I'll try to figure out how
to submit a ticket for the issue.
···
On Sep 3, 8:58 am, Andrea Gavana <andrea.gav...@gmail.com> wrote:
Hi Mark,
On 2 September 2010 04:11, Mark wrote:
> In UltimateListCtrl.py (python26\Lib\site-packages\wx-2.8-msw-unicode
> \wx\lib\agw) the function DoDeleteAllItems:
> Replace:
> for item in self._itemWithWindow:
> wnd = item.GetWindow()
> wnd.Destroy()
> with:
> for item in self._itemWithWindow:
> if item.GetWindow():
> self.DeleteItemWindow(item)
> And try it again, I'm guessing it will fix the problem. Backup the
> file first before editing it! Then make a report in Trac setting
> component AGW:wxTrac has been migrated to GitHub Issues - wxWidgets someone can review it
> more closely than I did.
Thank you for this, I'll try and update the SVN code when I get back
home. It would be nice to have a ticket for this, though.
Thanks that piece of code, it works great. I'll try to figure out how
to submit a ticket for the issue.
Hi Mark,
> In UltimateListCtrl.py (python26\Lib\site-packages\wx-2.8-msw-unicode
> \wx\lib\agw) the function DoDeleteAllItems:
> Replace:
> for item in self._itemWithWindow:
> wnd = item.GetWindow()
> wnd.Destroy()
> with:
> for item in self._itemWithWindow:
> if item.GetWindow():
> self.DeleteItemWindow(item)
> And try it again, I'm guessing it will fix the problem. Backup the
> file first before editing it! Then make a report in Trac setting
> component AGW:wxTrac has been migrated to GitHub Issues - wxWidgets someone can review it
> more closely than I did.
Thank you for this, I'll try and update the SVN code when I get back
home. It would be nice to have a ticket for this, though.