eventManager.Register fails on EVT_SCROLL (expectedIDs == 0)

Well this is peculiar:

'''Cannot register the macro, <wx._core.PyEventBinder object at 0x00C073B0>.
Register instead the individual events.'''

import wx
import wx.lib.evtmgr as em

app= wx.PySimpleApp()
frame= wx.Frame( None )
sizer= wx.BoxSizer( wx.VERTICAL )
scroll= wx.ScrollBar( frame )
sizer.Add( scroll, 0, wx.EXPAND )
frame.SetSizer( sizer )
frame.Show()

def f1( e ):
  print 'scroll'
  e.Skip()

#wx.EVT_SCROLL.expectedIDs == 0
em.eventManager.Register( f1, wx.EVT_SCROLL, scroll )
#scroll.Bind( wx.EVT_SCROLL, f1 ) #but Bind works.

app.MainLoop()

'''
C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\evtmgr.py:85:
DeprecationWarning: raising a string exception is deprecated
  raise 'Cannot register the macro, '+`event`+'. Register instead the
individual events.'
Traceback (most recent call last):
  File "C:\Documents and Settings\Aaron\My Documents\cs\what is bind
simpl.py", line 16, in <module>
    em.eventManager.Register( f1, wx.EVT_SCROLL, scroll )
  File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\evtmgr.py",
line 85, in Register
    raise 'Cannot register the macro, '+`event`+'. Register instead the
individual events.'
Cannot register the macro, <wx._core.PyEventBinder object at 0x00C073B0>.
Register instead the individual events.
'''

It's a limitation, not a bug per se, and it's just as decribed. You
can't use EVT_SCROLL, you have to register the wx.EVT_SCROLL_*
subevents individually.

···

On Jan 11, 2008 12:10 PM, Aaron Brady <castironpi@comcast.net> wrote:

Well this is peculiar:

'''Cannot register the macro, <wx._core.PyEventBinder object at 0x00C073B0>.
Register instead the individual events.'''

import wx
import wx.lib.evtmgr as em

app= wx.PySimpleApp()
frame= wx.Frame( None )
sizer= wx.BoxSizer( wx.VERTICAL )
scroll= wx.ScrollBar( frame )
sizer.Add( scroll, 0, wx.EXPAND )
frame.SetSizer( sizer )
frame.Show()

def f1( e ):
        print 'scroll'
        e.Skip()

#wx.EVT_SCROLL.expectedIDs == 0
em.eventManager.Register( f1, wx.EVT_SCROLL, scroll )
#scroll.Bind( wx.EVT_SCROLL, f1 ) #but Bind works.

app.MainLoop()

'''
C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\evtmgr.py:85:
DeprecationWarning: raising a string exception is deprecated
  raise 'Cannot register the macro, '+`event`+'. Register instead the
individual events.'
Traceback (most recent call last):
  File "C:\Documents and Settings\Aaron\My Documents\cs\what is bind
simpl.py", line 16, in <module>
    em.eventManager.Register( f1, wx.EVT_SCROLL, scroll )
  File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\evtmgr.py",
line 85, in Register
    raise 'Cannot register the macro, '+`event`+'. Register instead the
individual events.'
Cannot register the macro, <wx._core.PyEventBinder object at 0x00C073B0>.
Register instead the individual events.
'''