30 virtual ~MyMainFrame();
39 void MyMainFrame::DoSelect()
44 void 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());
94 MyMainFrame::~MyMainFrame()
104 void MyMainFrame::HandleButtons()
111 printf(
"HandleButton: id = %d\n",
id);
114 fListBox->SetMultipleSelections(fCheckMulti->GetState());
118 void 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);
R__EXTERN void * gTQSender
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
R__EXTERN TApplication * gApplication
#define ClassDef(name, id)
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...
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.