18 const char *
const icon1[] =
47 class MyMainFrame :
public TGMainFrame {
50 MyMainFrame(
const TGWindow *p, UInt_t w, UInt_t h);
51 virtual ~MyMainFrame();
55 ClassDef(MyMainFrame, 0)
58 void MyMainFrame::DoExit()
61 gApplication->Terminate(0);
64 MyMainFrame::MyMainFrame(
const TGWindow *p, UInt_t w, UInt_t h) :
69 TString name =
"myicon";
71 gClient->GetColorByName(
"yellow", yellow);
74 TGPicturePool *picpool = gClient->GetResourcePool()->GetPicturePool();
75 const TGPicture *iconpic = picpool->GetPicture(name.Data(),(
char **)icon1);
76 TGIcon *icon =
new TGIcon(
this, iconpic, 40, 40, kChildFrame, yellow);
77 AddFrame(icon,
new TGLayoutHints(kLHintsLeft, 1,15,1,1));
79 TGTextButton *exit =
new TGTextButton(
this,
"&Exit",
"gApplication->Terminate(0)");
80 AddFrame(exit,
new TGLayoutHints(kLHintsExpandX,2,0,2,2));
82 SetWindowName(
"Icon test");
84 Resize(GetDefaultSize());
88 MyMainFrame::~MyMainFrame()
97 new MyMainFrame(gClient->GetRoot(), 350, 80);