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. | |
TContext (TVirtualPad *gpad, Bool_t interactive=kFALSE, Bool_t not_null=kFALSE) | |
Constructor which stores gPad and set it to new value. | |
~TContext () | |
Destructor Restores previous value of gPad. | |
auto | GetSaved () const |
auto | IsInteractive () const |
void | PadDeleted (TVirtualPad *pad) |
Inform context that pad deleted or will be deleted soon Reference on that pad should be cleared. | |
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.
void TVirtualPad::TContext::PadDeleted | ( | TVirtualPad * | pad | ) |
Inform context that pad deleted or will be deleted soon Reference on that pad should be cleared.
Definition at line 73 of file TVirtualPad.cxx.
Definition at line 62 of file TVirtualPad.h.
|
private |
Definition at line 63 of file TVirtualPad.h.