[wxPython-users] Grid not deleting, but appending row on DeleteRow
Simen Haugen
Simen at nordicstats.com
Fri Jun 2 05:53:29 PDT 2006
Thanks a lot. I noticed my error... It's one of those - been working on
this bug for 3 hours and all I had was a typo - kind of bug.
My tablemessage call was missing position...
-Simen
-----Original Message-----
From: Michael J. Pedersen [mailto:m.pedersen at icelus.org]
Sent: 1. juni 2006 23:00
To: wxPython-users at lists.wxwidgets.org
Subject: Re: [wxPython-users] Grid not deleting, but appending row on
DeleteRow
On Thu, Jun 01, 2006 at 10:37:10PM +0200, Simen Haugen wrote:
> I have a custom table and grid, and when I try to delete rows, the
grid
> "Appends" another row and doesn't remove any rows.
First, allow the mostly clueless to try and answer :)
I think you're not handling the deletion of the row correctly. Here's
some code I've got which deletes a row:
msg = wx.grid.GridTableMessage(self,
wx.grid.GRIDTABLE_NOTIFY_ROWS_DELETED, self.dbnames.index(name), 1)
self.GetView().ProcessTableMessage(msg)
I have an array of dbnames in my custom table. I'm trying to delete the
row which contains the "name" variable. So, make a message, specifying
which table it comes from (self), what is being done
(wx.grid.GRIDTABLE_NOTIFY_ROWS_DELETED), the index of the row being
deleted (self.dbnames.index(name)), and how many rows are being deleted
(1). After that, make sure that the grid itself processes the update.
I hope this is of some use!
--
Michael J. Pedersen
My IM IDs: Jabber/pedersen at icelus.tzo.com, ICQ/103345809,
AIM/pedermj022171
Yahoo/pedermj2002, MSN/pedermj022171 at hotmail.com
My GnuPG KeyID: 4E724A60 My Public Key Available At:
pgp.mit.edu
My GnuPG Key Fingerprint: C31C 7E90 5992 9E5E 9A02 233D D8DD 985E 4E72
4A60
More information about the wxpython-users
mailing list