Quote:
Originally Posted by Fifthparallel
That's right. A CommandGroup inherits from Command. Whenever you press a button in the OI, it spawns a new object of XYZ CommandGroup. That is, it runs the constructor then and there on that button press (for a new Command/CommandGroup), which is exactly the functionality you want to have. On a quick test, it worked a few weeks earlier for me.
|
If you write in your OI constructor:
Code:
button->WhenPressed(new DoStuff());
That means one DoStuff instance is created, and that instance is passed to the "WhenPressed" function. It will be that same instance that runs every time the button is pressed. I don't see how this code will cause a new instance to be created every time the button is pressed.