Feature #577
WPopupMenu interface enhancement
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/28/2010
Due date:
% Done:
0%
Estimated time:
Description
It would be great if WPopupMenu had a pair of methods like this:
template
WPopupMenuItem* addItem( const WString& text, Func callback );
template
WPopupMenuItem* addItem( const std::string& iconPath, const WString& text, Func callback );
My use case is to create menu items dynamically, where each item should invoke a function with a specific parameter. I can define a struct and use setData, but I really don't want to use void* if I can avoid it. boost::bind lets me have one callback method with the parameter bound at the time the item is created.
The implementation is of course trivial, and I've added them in my local repository so I know it works.
Thanks!
Sean
No data to display