Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TVirtualPad::TContext Class Reference

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}
 
TVirtualPadfSaved {nullptr}
 

#include <TVirtualPad.h>

Constructor & Destructor Documentation

◆ TContext() [1/2]

TVirtualPad::TContext::TContext ( Bool_t  _interactive = kFALSE)

Constructor which just store gPad.

Parameters
_interactivedefines how gPad will be restored: with cd() call (kTRUE) or just by assign gPad back

Definition at line 36 of file TVirtualPad.cxx.

◆ TContext() [2/2]

TVirtualPad::TContext::TContext ( TVirtualPad gpad,
Bool_t  interactive = kFALSE,
Bool_t  not_null = kFALSE 
)

Constructor which stores gPad and set it to new value.

Parameters
interactivedefines how gPad will be restored: with cd() call (kTRUE) or just by assign gPad back
not_nullallows to set only pad which is not null

Definition at line 47 of file TVirtualPad.cxx.

◆ ~TContext()

TVirtualPad::TContext::~TContext ( )

Destructor Restores previous value of gPad.

Definition at line 61 of file TVirtualPad.cxx.

Member Function Documentation

◆ GetSaved()

auto TVirtualPad::TContext::GetSaved ( ) const
inline

Definition at line 69 of file TVirtualPad.h.

◆ IsInteractive()

auto TVirtualPad::TContext::IsInteractive ( ) const
inline

Definition at line 68 of file TVirtualPad.h.

◆ PadDeleted()

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.

Member Data Documentation

◆ fInteractive

Bool_t TVirtualPad::TContext::fInteractive {kFALSE}
private

Definition at line 62 of file TVirtualPad.h.

◆ fSaved

TVirtualPad* TVirtualPad::TContext::fSaved {nullptr}
private

Definition at line 63 of file TVirtualPad.h.

  • core/base/inc/TVirtualPad.h
  • core/base/src/TVirtualPad.cxx