24 TGLabel *fLbl1, *fLbl2, *fLbl3, *fLbl4;
28 virtual ~MyMainFrame();
35void MyMainFrame::DoSwitch()
37 if (fLbl1->IsDisabled()) {
38 printf(
"Enabled labels\n");
44 printf(
"Disabled labels\n");
52void MyMainFrame::DoExit()
64 const TGFont *font =
gClient->GetFont(
"-*-times-bold-r-*-*-18-*-*-*-*-*-*-*");
66 font =
gClient->GetResourcePool()->GetDefaultFont();
76 gClient->GetColorByName(
"yellow", ycolor);
77 gClient->GetColorByName(
"blue", bcolor);
80 fLbl1 =
new TGLabel(
this,
"OwnFont & Bck/ForgrColor", fTextGC->
GetGC(),
83 fLbl1->SetTextColor(ycolor);
85 fLbl2 =
new TGLabel(
this,
"Own Font & ForegroundColor", fTextGC->
GetGC(),
88 fLbl2->SetTextColor(ycolor);
90 fLbl3 =
new TGLabel(
this,
"Normal Label");
93 fLbl4 =
new TGLabel(
this,
"Multi-line label, resized\nto 300x80 pixels",
96 fLbl4->SetTextColor(ycolor);
97 fLbl4->ChangeOptions(fLbl4->GetOptions() |
kFixedSize);
98 fLbl4->Resize(350, 80);
102 toggle->
Connect(
"Clicked()",
"MyMainFrame",
this,
"DoSwitch()");
103 toggle->
SetToolTipText(
"Click on the button to toggle label's state (enable/disable)");
106 exit->
Connect(
"Pressed()",
"MyMainFrame",
this,
"DoExit()");
110 SetWindowName(
"Labels");
114 Resize(GetDefaultSize());
120MyMainFrame::~MyMainFrame()
129 new MyMainFrame(
gClient->GetRoot(), 200, 200);
const Mask_t kGCBackground
const Mask_t kGCForeground
Handle_t FontStruct_t
Pointer to font structure.
#define ClassDef(name, id)
R__EXTERN TApplication * gApplication
void Printf(const char *fmt,...)
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.
ULong_t fBackground
background pixel
Mask_t fMask
bit mask specifying which fields are valid
FontH_t fFont
default text font for text operations