Associating data to a menu

Lloyd lloyd at cdactvm.in
Tue Feb 13 22:36:55 PST 2007



On Tue, 2007-02-13 at 14:45 +0100, Vadim Zeitlin wrote:
> But now I realize that you probably speak about menu _items_ when you
> say
> "menu". In this case my advice doesn't apply and you will have to use
> different ids to be able to distinguish between the items.
> 

Yes you are right. So I must use different IDs. Is following way the
right solution?
 *) Allocate a range  of IDs for the newly adding menu items
 *) Append each menu item with distinct ids, and also make a table,
whose each entry contains menu id and its corresponding data.
 *) As soon as the new menu item is appended, connect it to the event
handler function using wxEvtHandler::Connect()
 *)  In the event handler function Get the event ID (using
wxEvent::GetId()), and get the data from table using this id...

Is this the right way to solve this problem?

Thanks and Regards,
  Lloyd



______________________________________
Scanned and protected by Email scanner




More information about the wx-users mailing list