30 virtual ~MyMainFrame();
39void MyMainFrame::DoSelect()
44void MyMainFrame::DoExit()
56 fSelected =
new TList;
58 for (
int i = 0; i < 20; ++i) {
59 sprintf(tmp,
"Entry %i", i+1);
60 fListBox->AddEntry(tmp, i+1);
62 fListBox->Resize(100,150);
67 fCheckMulti =
new TGCheckButton(
this,
"&Mutliple selection", 10);
70 fCheckMulti->Connect(
"Clicked()",
"MyMainFrame",
this,
"HandleButtons()");
74 show->
SetToolTipText(
"Click here to print the selection you made");
75 show->
Connect(
"Pressed()",
"MyMainFrame",
this,
"PrintSelected()");
78 exit->
Connect(
"Pressed()",
"MyMainFrame",
this,
"DoExit()");
83 SetWindowName(
"List Box");
87 Resize(GetDefaultSize());
94MyMainFrame::~MyMainFrame()
104void MyMainFrame::HandleButtons()
111 printf(
"HandleButton: id = %d\n",
id);
114 fListBox->SetMultipleSelections(fCheckMulti->GetState());
118void MyMainFrame::PrintSelected()
124 if (fListBox->GetMultipleSelections()) {
125 Printf(
"Selected entries are:\n");
126 fListBox->GetSelectedEntries(fSelected);
129 Printf(
"Selected entries is: %d\n", fListBox->GetSelected());
136 new MyMainFrame(
gClient->GetRoot(), 200, 200);
#define ClassDef(name, id)
R__EXTERN TApplication * gApplication
R__EXTERN void * gTQSender
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...
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
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.