Got traceback from using the wxpython demo's icon

Hi,

I am trying to put an icon on my frame/taskbar. To try out the code, I found
the images.py file from the wxpython demo, and stuffed it into my package, and

then copied the 2 lines below...

        icon = images.getMondrianIcon()
        self.SetIcon(icon)

... to my frame.__init__() method. This is the (partial) traceback I got...

  File "controlpanel.py", line 41, in __init__
    icon = images.getMondrianIcon()
  File "C:\sharedata\python\aktv\images.py", line 28, in getMondrianIcon
    icon.CopyFromBitmap(getMondrianBitmap())
  File "C:\sharedata\python\aktv\images.py", line 20, in getMondrianBitmap
    return wxBitmapFromImage(getMondrianImage())
  File "C:\Python22\lib\site-packages\wxPython\image.py", line 394, in
wxBitmapFromImage
    val = imagec.wxBitmapFromImage(*_args,**_kwargs)
wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed in
c:\PROJECTS\wx\src\msw\bitmap.cpp(507): invalid image

The wxpython demo can run, but mine can't? How come? Ideally I would like to
use the img2py.py file to generate the image data from a xpm file... what is
the requirement of that xpm file, besides 32x32 in size and 16 colours?

Thanks in advance,
Alex

···

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Alex Li wrote:

    val = imagec.wxBitmapFromImage(*_args,**_kwargs)
wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed in c:\PROJECTS\wx\src\msw\bitmap.cpp(507): invalid image

The wxpython demo can run, but mine can't? How come? Ideally I would like to
use the img2py.py file to generate the image data from a xpm file... what is
the requirement of that xpm file, besides 32x32 in size and 16 colours?

Do you call wxInitAllImageHandlers() in your app?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!