A class restoring the previous TStyle
on destruction.
More...
#include <ROOTutils.h>
Public Member Functions | |
TStyleChanger () | |
TStyleChanger (TStyle *newStyle) | |
~TStyleChanger () | |
void | save () |
Stores the current style as the one to be saved. More... | |
void | restore () const |
void | forget () |
Do not restore the old style on destruction. More... | |
void | cd () const |
Make the stored new style as current again. More... | |
void | cd (TStyle *newStyle) |
Make the specified style as current. More... | |
TStyle * | saved () const |
Returns a pointer to the style that will be restored on destruction. More... | |
bool | hasSaved () const |
Returns whether there is a style to be restored on destruction. More... | |
Private Attributes | |
TStyle * | pSaved = nullptr |
TStyle * | pNew = nullptr |
A class restoring the previous TStyle
on destruction.
When an instance of this object is created, the existing current style is saved, and it is then restored on destruction.
Additional methods allow finer control on the restoration feature.
Example:
Definition at line 127 of file ROOTutils.h.
|
inline |
Definition at line 134 of file ROOTutils.h.
|
inline |
Definition at line 135 of file ROOTutils.h.
|
inline |
Definition at line 137 of file ROOTutils.h.
|
inline |
|
inline |
Make the specified style as current.
Definition at line 153 of file ROOTutils.h.
|
inline |
|
inline |
Returns whether there is a style to be restored on destruction.
Definition at line 159 of file ROOTutils.h.
|
inline |
Immediately restores the old style. It will still restored on destruction too.
Definition at line 144 of file ROOTutils.h.
|
inline |
|
inline |
Returns a pointer to the style that will be restored on destruction.
Definition at line 156 of file ROOTutils.h.
|
private |
Definition at line 130 of file ROOTutils.h.
|
private |
Definition at line 129 of file ROOTutils.h.