wx.ToplevelWindow.SetIcon: Native MS Windows error dialog pops up in wxPython app, no exception raised, no stack trace

Laszlo Nagy gandalf at designaproduct.biz
Thu Sep 13 07:29:06 EDT 2007


  Hello,

I wrote a small program that works uses wxPython. The same application 
works on Linux and Windows. When I start it from MS Windows, I see this 
error message appearing each time I open a window:

---------------------------
Warehouseclient Error
---------------------------
Can't load image from file '': file does not exist.
---------------------------
OK  
---------------------------


The message box itself is a native MS Windows dialog. Otherwise the 
program works fine, just here is this annoying message. There is no 
exception raised in the Python program. Nothing printed on console. I 
figured out that this happens only when I set the icon of the window 
using this code:

self.SetIcon(icon)

However, the error dialog is not displayed right after the SetIcon call 
and no exception is raised. The dialog is displayed after __init__ has 
been called, and probably before EVT_SHOW gets called. Documentation of 
SetIcon 
(http://wxwidgets.org/manuals/stable/wx_wxtoplevelwindow.html#wxtoplevelwindowseticon) 
says that it is safe to delete the icon after calling this function. Now 
here are the wreid things:

1. The icon is displayed correctly in the left top corner, so where is 
the error?
2. The error message complains about a file. What has 
wx.ToplevelFrame.SetIcon do with files?

I'm using: Windows XP Professional, Python 2.5, wxPython 2.8

Thanks,

   Laszlo




More information about the Python-list mailing list