35 Int_t GetUnID(
void) {
return ++nID ; }
38 class TableTest :
public TGMainFrame {
46 UInt_t fNTableColumns;
47 TGSimpleTable *fSimpleTable;
50 TableTest(
const TGWindow *p, UInt_t ndrows, UInt_t ndcols,
51 UInt_t ntrows, UInt_t ntcols, UInt_t w = 100, UInt_t h = 100) ;
52 virtual ~TableTest() ;
56 TGSimpleTable *GetTable() {
return fSimpleTable; }
58 ClassDef(TableTest, 0)
61 TableTest::TableTest(
const TGWindow *p, UInt_t ndrows, UInt_t ndcols,
62 UInt_t ntrows, UInt_t ntcols, UInt_t w, UInt_t h)
63 : TGMainFrame(p, w, h), fData(0), fNDataRows(ndrows), fNDataColumns(ndcols),
64 fNTableRows(ntrows), fNTableColumns(ntcols), fSimpleTable(0)
66 SetCleanup(kDeepCleanup) ;
67 Connect(
"CloseWindow()",
"TableTest",
this,
"DoExit()") ;
72 fData =
new Double_t*[fNDataRows];
73 for (i = 0; i < (Int_t)fNDataRows; i++) {
74 fData[i] =
new Double_t[fNDataColumns];
75 for (j = 0; j < (Int_t)fNDataColumns; j++) {
76 fData[i][j] = 10 * i + j;
81 fSimpleTable =
new TGSimpleTable(
this, IDs.GetUnID(), fData, fNTableRows,
83 AddFrame(fSimpleTable,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
86 SetWindowName(
"TGSimpleTable Test") ;
89 Resize(GetDefaultWidth()+20, 600) ;
94 TableTest::~TableTest()
98 for (i = 0; i < fNDataRows; i++) {
105 void TableTest::DoExit()
116 TGSimpleTable *simpleTableTest(UInt_t ndrows = 500, UInt_t ndcols = 20,
117 UInt_t ntrows = 50, UInt_t ntcols = 10) {
118 TableTest *test =
new TableTest(0, ndrows, ndcols, ntrows, ntcols, 500, 200);
119 return test->GetTable();