about popup menus

hello..

I want to bind all the items (or options) in a popup menu to one method, but I need to later in that method find a way to know what item was selected (more specific I just need the title string of the item)..

I have done this with buttons:

def OnButtonsClic(self, evt):
         """Funcion que se ejecuta luego de hacer clic en algun boton
         del panel derecho de la ventana principal
         """
         button = evt.GetEventObject()
         id = button.GetId()
         ......

but the wx.Menu doesnt have a GetId() method. Is it possible to do what I want?

Hi,
does maybe a direct id lookup of the menu event work, like:
evt.GetId()
? Of course, provided, the menu items are given ids.

hth,
   vbr

···

2011/4/8 PythonJourney <pythonjourney@gmail.com>:

hello..

I want to bind all the items (or options) in a popup menu to one method, but
I need to later in that method find a way to know what item was selected
(more specific I just need the title string of the item)..

I have done this with buttons:

def OnButtonsClic(self, evt):
"""Funcion que se ejecuta luego de hacer clic en algun boton
del panel derecho de la ventana principal
"""
button = evt.GetEventObject()
id = button.GetId()
......

but the wx.Menu doesnt have a GetId() method. Is it possible to do what I
want?

El 07/04/2011 08:22 p.m., Vlastimil Brom escribi�:

···

2011/4/8 PythonJourney<pythonjourney@gmail.com>:

hello..

I want to bind all the items (or options) in a popup menu to one method, but
I need to later in that method find a way to know what item was selected
(more specific I just need the title string of the item)..

I have done this with buttons:

def OnButtonsClic(self, evt):
        """Funcion que se ejecuta luego de hacer clic en algun boton
        del panel derecho de la ventana principal
        """
        button = evt.GetEventObject()
        id = button.GetId()
        ......

but the wx.Menu doesnt have a GetId() method. Is it possible to do what I
want?

Hi,
does maybe a direct id lookup of the menu event work, like:
evt.GetId()
? Of course, provided, the menu items are given ids.

hth,
    vbr

thanks that worked!!...