TGSimpleTable+¶
TGSimpleTable 继承 TGTable
A simple table that owns it’s interface.
class¶
TGSimpleTable(TGWindow *p, Int_t id, Double_t **data,
UInt_t nrows, UInt_t ncolumns);
virtual ~TGSimpleTable();
code¶
#include "TGSimpleTable.h"
// TGSimpleTable
// 简单数据表格
Double_t **fData;
UInt_t fNDataRows;
UInt_t fNDataColumns;
UInt_t fNTableRows;
UInt_t fNTableColumns;
TGSimpleTable *fSimpleTable;
Int_t i = 0, j = 0;
fData = new Double_t*[fNDataRows];// Create the needed data.
for (i = 0; i < (Int_t)fNDataRows; i++) {
fData[i] = new Double_t[fNDataColumns];
for (j = 0; j < (Int_t)fNDataColumns; j++) {
fData[i][j] = 10 * i + j;
}
}
fSimpleTable = new TGSimpleTable(frame, IDs, fData, fNTableRows, fNTableColumns);
frame->AddFrame(fSimpleTable, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));