menubar events

Hello, I’m trying to capture a menubar
event and I’m having some difficulty. I want to know for example when a
user is going open the File menu.

I was read the docs and it says: “To respond to a menu selection,
provide a handler for EVT_MENU, in the frame that contains the menu bar.” So
I tried the following since Frame1 contains the menubar:

self.Bind(wx.EVT_MENU,
self.OnFrame1MenuBar, id=wxID_FRAME1)

Frame1 is a MDI parent frame. When the event happens, the program doesn’t call the
event handler (OnFrame1MenuBar). What might I need to do here? Thanks.

Jeff

···

Jeffrey Thomas Peery

SeaMetrics, Inc.

Mechanical Engineer

JeffPeery@SeaMetrics.com

253.872.0285 (fax)

253.872.0284 (phone)


Hello, I’m trying to capture a menubar event and I’m having some
difficulty. I want to know for example when a user is going open the
File menu.

I was read the docs and it says: "To respond to a menu selection,
provide a handler for EVT_MENU, in the frame that contains the menu
bar." So I tried the following since Frame1 contains the menubar:

self.Bind(wx.EVT_MENU, self.OnFrame1MenuBar, id=wxID_FRAME1)

The id argument for EVT_MENU corresponds to ID of the menu item, and you
seem to be passing the ID of the frame. If you want to catch all menu
events, just omit this argument.

···

On Mon, 2007-07-30 at 16:56 -0700, Jeff Peery wrote:

Frame1 is a MDI parent frame. When the event happens, the program
doesn't call the event handler (OnFrame1MenuBar). What might I need to
do here? Thanks.

Jeff

______________________________________________________________________
Jeffrey Thomas Peery

SeaMetrics, Inc.

Mechanical Engineer

JeffPeery@SeaMetrics.com

253.872.0285 (fax)

253.872.0284 (phone)

______________________________________________________________________