Handle an event with a wxMenuItem

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies
Contact:

Handle an event with a wxMenuItem

Post by GianT » Tue Jun 21, 2005 5:01 pm

Hi, that's me again :oops: . In my program, I make a menu with some basics items, then I add items after reading a file. By this way, I can set events for the basic items (in the table event) but not for the items added after. I thought about the setEventHandler method, but it doesn't exist in wxMenuItem class, since it doesn't derive from wxWindow class. How could I do that?

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Re: Handle an event with a wxMenuItem

Post by ABX » Tue Jun 21, 2005 5:12 pm

GianT wrote:Hi, that's me again :oops: . In my program, I make a menu with some basics items, then I add items after reading a file. By this way, I can set events for the basic items (in the table event) but not for the items added after. I thought about the setEventHandler method, but it doesn't exist in wxMenuItem class, since it doesn't derive from wxWindow class. How could I do that?
Look at the samples/menu sample. I remember there was dynamic menu creation presented.

ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2

GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies
Contact:

Post by GianT » Tue Jun 21, 2005 5:19 pm

I can't find this in my release, here are the available samples:
  • Minimal sample
    Art provider sample
    Calendar sample
    Checklist sample
    Config sample
    Controls sample
    Database sample
    Dialogs sample
    Dialup sample
    DnD sample
    Dynamic sample
    Event sample
    Except(ions) sample
    Exec sample
    Font sample
    Grid sample
    HTML samples
    Image sample
    Internat(ionalization) sample
    Layout sample
    Listctrl sample
    Mediaplayer sample
    Notebook sample
    Render sample
    Rotate sample
    Scroll subwindow sample
    Sockets sample
    Sound sample
    Statbar sample
    Text sample
    Thread sample
    Toolbar sample
    Treectrl sample
    Wizard sample

GianT
Earned some good credits
Earned some good credits
Posts: 124
Joined: Wed Mar 16, 2005 5:44 pm
Location: Guadeloupe, French West Indies
Contact:

Post by GianT » Tue Jun 21, 2005 5:25 pm

Ohh, sorry, I was wondering for days where were the samples they were talking about in the help file :oops: . I never saw the sample directory, I'm confused :oops:

Post Reply