[wxPython-users] Solution to: pyGridTableBase & MySQL Data

Werner F. Bruhin werner.bruhin at free.fr
Sat Feb 3 01:53:46 PST 2007


Hi Telly,

Telly Williams wrote:
> Hey everyone,
>
> 	I've been working on the problem with getting new data into the wx.grid
> when I want new information from MySQL.  I found a solution that works
> for me, for now.  I'm not a good programmer, but I thought I'd pass
> along this bit of info on the solution I found.  I'd love to put this
> into the documentation, but it gets this error whenever I click my
> OnClick button:
>
> #----------BEGIN ERROR MESSAGE----------------
>
> Traceback (most recent call last):
>   File "C:\Python24\Programs\DJSuite\wxgridcopy.py", line 166, in OnClick
>     self.grid.AutoSize()
>   File "C:\Python24\lib\site-packages\wx-2.6-msw-ansi\wx\_core.py", line
> 13485, in __getattr__
>     raise PyDeadObjectError(self.attrStr % self._name)
> wx._core.PyDeadObjectError: The C++ part of the Grid object has been
> deleted, attribute access no longer allowed.
>   
Your first line of OnClick destroys self.grid  and then later on you do 
self.grid.AutoSize() but at that time self.grid is no longer there and 
therefore you get the PyDeadObjectError.

Have you seen the wiki pages on this?

http://wiki.wxpython.org/index.cgi/UpdatingGridData?highlight=%28grid%29

Werner




More information about the wxpython-users mailing list