[wxPython] Newbie problem with setting up a menu

I am new to wxPython.
Porting a small application from PyQt / Linux to wxPython / Windows was
astonishingly simple (as far) but now I am vaing a problem:

I am seting up a menu am write:

     EVT_MENU_RANGE(self,100,105,self.widget.sheet.strecke_koordinaten)
      EVT_MENU_RANGE(self,200,217,self.widget.sheet.verschiebe_koordinaten)

The functions, that should receive the menu events, are for example

  def strecke_koordinaten(self,evt):
      print '**',evt.GetInt()
      d = faktoren[evt.GetInt()-100]
      print 'd=',d,n-100
      self.set_coordinate_system(self.x0*d,self.y0*d,self.x1*d,self.y1*d)
      self.Refresh()

Now this does not work, this function never gets called.

Can anybody help me?

TIA,

···

--
Janos Blazi

jblazi wrote:

I am new to wxPython.
Porting a small application from PyQt / Linux to wxPython / Windows was astonishingly simple (as far) but now I am vaing a problem:

I am seting up a menu am write:

     EVT_MENU_RANGE(self,100,105,self.widget.sheet.strecke_koordinaten)
      EVT_MENU_RANGE(self,200,217,self.widget.sheet.verschiebe_koordinaten)

The functions, that should receive the menu events, are for example

  def strecke_koordinaten(self,evt):
      print '**',evt.GetInt()
      d = faktoren[evt.GetInt()-100]
      print 'd=',d,n-100
      self.set_coordinate_system(self.x0*d,self.y0*d,self.x1*d,self.y1*d)
      self.Refresh()
Now this does not work, this function never gets called.

Are the menu items created with an id in the ranges 100-105 or 200-217? Is the 'self' in the EVT_* calls the frame that the menubar is attached to?

···

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