-
erreur dans StaticBitmap
Bonjour depuis peu je reçois le message d'erreur suivant et la je seche
> Executing: C:\Program Files (x86)\ConTEXT\ConExec.exe "C:\Python26\pythonw.exe" "Appli.py"
d:\ProjetBiblio\Biblio
d:\ProjetBiblio\Biblio
Traceback (most recent call last):
File "D:\ProjetBiblio\Photos.py", line 259, in onNewPhoto
self.Image.SetBitmap(wx.BitmapFromImage(img ))
File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14568, in __getattr__
raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the StaticBitmap object has been deleted, attribute access no longer allowed.
> Execution finished.
voici le code
# On affiche les photos disponible
dlg = ib.ImageDialog(self, self.init_dir)
dlg.Centre()
if dlg.ShowModal() == wx.ID_OK:
img = wx.Image(dlg.GetFile(),wx.BITMAP_TYPE_ANY)
img = img.Scale(250,250)
self.Image.SetBitmap(wx.BitmapFromImage(img ))
self.txtTitre.SetValue(os.path.basename(dlg.GetFile()))
et la définition de Image
# Image
self.Image = wx.StaticBitmap(id= 2131, parent=self, pos=(500,320),size=(250,250) )
Cela marchait , mais après des ajouts dans d'autres source du projet, errreur.
HELPPPPPPPP merci