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
#define ClassDef(name, id)
R__EXTERN TApplication * gApplication
virtual void Terminate(Int_t status=0)
FontStruct_t GetFontStruct() const
FontH_t GetFontHandle() const
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.