Problem with wxPython extension

Hmm, there are some switches you should try, my best idea is currently the

"-modern" switch. Take a look at the options Robin uses for the default wx

build and compare them with yours. To me this seems like different command

line options.

One step further... I am now able to build my extension and import my module
(thanks, it was my swig command line options), although I get a traceback
when constructing my object...

Traceback (most recent call last):
  File "C:\projects\mvp\maestro_v3\src\base\python\msw\t.py", line 16, in ?
    frame = MainWindow(None,-1,'Small editor')
  File "C:\projects\mvp\maestro_v3\src\base\python\msw\t.py", line 9, in
__init__
    self.control = m2u_base.mvpBaseCanvas(self,1)
  File "C:\projects\mvp\maestro_v3\src\base\python\msw\m2u_base.py", line
65, in __init__
    self._setOORInfo(self)
  File "C:\Python24\Lib\site-packages\wx-2.6-msw-unicode\wx\_core.py", line
3406, in _setOORInfo
    return _core_.EvtHandler__setOORInfo(*args, **kwargs)
TypeError: argument number 1: a 'wxEvtHandler *' is expected,
'PySwigObject(_p_mvpBaseCanvas)' is received

This is my test script...

import wx
import m2u_base

class MainWindow(wx.Frame):
    def __init__(self,parent,id,title):
        wx.Frame.__init__(self,parent,wx.ID_ANY,title,size=(200,100),

style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE)
                
        self.control = m2u_base.mvpBaseCanvas(self,1)
        self.Show(True)

app = wx.PySimpleApp()

frame = MainWindow(None,-1,'Small editor')
app.MainLoop()

Any ideas?

···

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Traceback (most recent call last):
  File "C:\projects\mvp\maestro_v3\src\base\python\msw\t.py", line 16, in ?
    frame = MainWindow(None,-1,'Small editor')
  File "C:\projects\mvp\maestro_v3\src\base\python\msw\t.py", line 9, in
__init__
    self.control = m2u_base.mvpBaseCanvas(self,1)
  File "C:\projects\mvp\maestro_v3\src\base\python\msw\m2u_base.py", line
65, in __init__
    self._setOORInfo(self)

try changing the last line to
self._setOORInfo(wx.EvtHandlerPtr(self))

It seems swig doesn't recognize self as a valid wxEvtHandler object. If the above fix works (I am really not sure) then you could probably fiddle around with the swig implicit.i library module to get _setOORInfo recognize the param correctly.
This is just a guess here though, don't be surprised if the new line above doesn't work.
You somehow need to convert self (which is a mvpBaseCanvas object directly derived from wx.ScrolledWindow and thus is a wx.EvtHandler) into a wx.EvtHandler. For some reason swig does not recognize that.