protected:
public:
void CloseWindow();
};
{
fSpeedo =
new TGSpeedo(
this, 0.0, 100.0,
"CPU",
"[%]");
fSpeedo->Connect("OdoClicked()", "TGShapedMain", this, "ToggleInfos()");
fSpeedo->Connect("LedClicked()", "TGShapedMain", this, "CloseWindow()");
Connect("CloseWindow()", "TGShapedMain", this, "CloseWindow()");
fSpeedo->SetDisplayText("Used RAM", "[MB]");
fTimer->SetCommand("Update()");
fBgnd = fSpeedo->GetPicture();
if (fBgnd) {
gVirtualX->ShapeCombineMask(GetId(), 0, 0, fBgnd->GetMask());
SetBackgroundPixmap(fBgnd->GetPicture());
SetWMSizeHints(fBgnd->GetWidth(), fBgnd->GetHeight(), fBgnd->GetWidth(), fBgnd->GetHeight(), 1, 1);
}
MapWindow();
DontCallClose();
Resize(GetDefaultSize());
SetWMSizeHints(GetDefaultWidth(), GetDefaultHeight(), GetDefaultWidth(), GetDefaultHeight(), 1, 1);
SetWindowName("ROOT CPU Load Meter");
fTimer->TurnOn();
}
void TGShapedMain::ToggleInfos()
{
else
fSpeedo->SetDisplayText("Total RAM", "[MB]");
fSpeedo->SetDisplayText("Used RAM", "[MB]");
fSpeedo->SetDisplayText("Free RAM", "[MB]");
}
TGShapedMain::~TGShapedMain()
{
delete fTimer;
delete fSpeedo;
}
void TGShapedMain::CloseWindow()
{
if (fTimer)
fTimer->TurnOff();
DestroyWindow();
}
void Update()
{
}
}
}
{
gSpeedo->SetThresholds(12.5, 50.0, 87.5);
}
#define ClassDef(name, id)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t SetWMSizeHints
R__EXTERN TSystem * gSystem
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
TGSpeedo is a widget looking like a speedometer, with a needle, a counter and a small odometer window...
ROOT GUI Window base class.
virtual int GetMemInfo(MemInfo_t *info) const
Returns ram and swap memory usage info into the MemInfo_t structure.
virtual int GetCpuInfo(CpuInfo_t *info, Int_t sampleTime=1000) const
Returns cpu load average and load info into the CpuInfo_t structure.
Handles synchronous and a-synchronous timer events.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)