PDA

View Full Version : Context Menu



RY
10th September 2008, 03:09
If you want to have several different objects that you can click on for a context menu unique to that item, is the context menu suppose to be part of that object (in the class definition)?

Are the actions also part of the object? Or can you only have actions created in main()?

wysota
10th September 2008, 07:59
You can create actions (and other objects) whenever you want. You can even create them when a menu handler is called and destroy them after the menu is closed. I wouldn't do that though, as I assume those actions can be useful also outside a context menu (for instance as icons in a toolbar).