small helper class to store/restore gPad context in TPad methods
Small helper class to preserve gPad, which will be restored when TContext object is destroyed.
Definition at line 61 of file TVirtualPad.h.
Public Member Functions | |
TContext (Bool_t _interactive=kFALSE) | |
Constructor which just store gPad. More... | |
TContext (TVirtualPad *gpad, Bool_t interactive=kFALSE, Bool_t not_null=kFALSE) | |
Constructor which stores gPad and set it to new value. More... | |
~TContext () | |
Destructor Restores previous value of gPad. More... | |
auto | GetSaved () const |
auto | IsInteractive () const |
Private Attributes | |
Bool_t | fInteractive {kFALSE} |
TVirtualPad * | fSaved {nullptr} |
#include <TVirtualPad.h>
Constructor which just store gPad.
_interactive | defines how gPad will be restored: with cd() call (kTRUE) or just by assign gPad back |
Definition at line 36 of file TVirtualPad.cxx.
TVirtualPad::TContext::TContext | ( | TVirtualPad * | gpad, |
Bool_t | interactive = kFALSE , |
||
Bool_t | not_null = kFALSE |
||
) |
Constructor which stores gPad and set it to new value.
interactive | defines how gPad will be restored: with cd() call (kTRUE) or just by assign gPad back |
not_null | allows to set only pad which is not null |
Definition at line 47 of file TVirtualPad.cxx.
TVirtualPad::TContext::~TContext | ( | ) |
Destructor Restores previous value of gPad.
Definition at line 61 of file TVirtualPad.cxx.
|
inline |
Definition at line 69 of file TVirtualPad.h.
|
inline |
Definition at line 68 of file TVirtualPad.h.
Definition at line 62 of file TVirtualPad.h.
|
private |
Definition at line 63 of file TVirtualPad.h.