23 TGLabel *fLbl1, *fLbl2, *fLbl3, *fLbl4;
28 ~MyMainFrame()
override;
35void MyMainFrame::DoSwitch()
37 if (fLbl1->IsDisabled()) {
38 printf(
"Enabled labels\n");
44 printf(
"Disabled labels\n");
52void MyMainFrame::DoExit()
63 const TGFont *font =
gClient->GetFont(
"-*-times-bold-r-*-*-18-*-*-*-*-*-*-*");
65 font =
gClient->GetResourcePool()->GetDefaultFont();
70 gClient->GetColorByName(
"yellow",
gval.fBackground);
74 gClient->GetColorByName(
"yellow", ycolor);
75 gClient->GetColorByName(
"blue", bcolor);
80 fLbl1->SetTextColor(ycolor);
82 fLbl2 =
new TGLabel(
this,
"Own Font & ForegroundColor", fTextGC->
GetGC(), labelfont);
84 fLbl2->SetTextColor(ycolor);
86 fLbl3 =
new TGLabel(
this,
"Normal Label");
89 fLbl4 =
new TGLabel(
this,
"Multi-line label, resized\nto 300x80 pixels", fTextGC->
GetGC(), labelfont,
kChildFrame,
92 fLbl4->SetTextColor(ycolor);
93 fLbl4->ChangeOptions(fLbl4->GetOptions() |
kFixedSize);
94 fLbl4->Resize(350, 80);
98 toggle->
Connect(
"Clicked()",
"MyMainFrame",
this,
"DoSwitch()");
99 toggle->
SetToolTipText(
"Click on the button to toggle label's state (enable/disable)");
102 exit->
Connect(
"Pressed()",
"MyMainFrame",
this,
"DoExit()");
106 SetWindowName(
"Labels");
110 Resize(GetDefaultSize());
116MyMainFrame::~MyMainFrame()
125 new MyMainFrame(
gClient->GetRoot(), 200, 200);
const Mask_t kGCBackground
const Mask_t kGCForeground
Handle_t FontStruct_t
Pointer to font structure.
#define ClassDefOverride(name, id)
R__EXTERN TApplication * gApplication
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 WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t gval
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
FontH_t GetFontHandle() const
Encapsulate a graphics context used in the low level graphics.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
Yield an action as soon as it is clicked.
ROOT GUI Window base class.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Graphics context structure.