Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problem on wx 2.6.x on linux debian 3.1

2005-11-09
2012-09-14
  • I have two problems with the last version:

    if I execute:
    python pype.py
    I receive this error:

    File "pype.py", line 4082, in main
    il.AddIcon(wxIcon('icons/py.ico', wxBITMAP_TYPE_ICO))
    File "/usr/lib/python2.3/site-packages/wx-2.6-gtk2-ansi/wx/gdi.py", line 4672, in AddIcon
    return _gdi
    .ImageList_AddIcon(args, *kwargs)
    wx._core.PyAssertionError: C++ assertion "(bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height) || (m_width == 0 && m_height == 0)" failed in ../src/generic/imaglist.cpp(81): invalid bitmap size in wxImageList: this might work on this platform but definitely won't under Windows.

    If I comment the line 4082, pype work.

    The second is that if I modify the source with the previous trick, when I try to open a python source file (with the file->open menu), pype say me this:
    [ Wed Nov 9 14:26:51 2005 ] Loading history from /home/michele/.pype/history.txt
    [ Wed Nov 9 14:26:58 2005 ] found filetype-specific defaults python
    Segmentation fault

    So it crash. What I can do for help you to debug?
    Michele

     
    • Josiah Carlson
      Josiah Carlson
      2005-11-10

      Add debug printouts to PythonSTC.SetText to discover where the segfault is happening.

       
      • The problem was at line 3325:
        wxNotebook.AddPage(self, page, text, switch, which)

        because the notebook didn't find the imagelist, that I remove for the previous problem, so for resolve this problem I had to resolve the first. At line 4086 I add this code because you must add to the wxImageList an icon that has the same size that you declare:

        img = wxImageFromBitmap(wxBitmap('icons/py.ico'))
        img.Rescale(16,16)
        bmp = wxBitmapFromImage(img)
        il.AddIcon(wxIconFromBitmap(bmp))

        Make all work fine,
        Michele

         
        • Josiah Carlson
          Josiah Carlson
          2005-11-11

          I've incorporated a variant of your change into PyPE, and will be releasing a new version shortly.

          Thank you for your help.