23 TGLabel *fLbl1, *fLbl2, *fLbl3, *fLbl4;
24 TGTextButton *fToggle;
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);
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.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
#define ClassDefOverride(name, id)
externTApplication * gApplication
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
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.
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
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.
Mask_t fMask
bit mask specifying which fields are valid