O'Reilly logo

Getting Started With JUCE by Martin Robinson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Employing undo management

JUCE includes an UndoManager class to help manage undo and redo actions. This can be used independently, but works almost automatically if the application's data is stored in a ValueTree object. To illustrate this we need to make a few changes to the project developed so far. First make some changes in the Introjucer project. Add a TextButton subcomponent labeled Undo and change its name and member name to undoButton. In the Class panel add the ValueTree::Listener class to the Parent classes property such that it reads:

public Component, public ValueTree::Listener

Save all the files and the project, and open it into your IDE. Add the following code for the ValueTree::Listener class to the [UserMethods] section of the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required