Intro

The TGTableLayout is a LayoutManager for ROOT's TGCompositeFrame. It steals heavily from GTK+'s gtktable.c and slightly from TGMatrixLayout. It lets you layout ROOT TGFrames in a tabular way. With this layout manager, you can: Because this layout manager needs features not yet present in ROOT some small modifications are needed. See below for details.

Source

The current state of the source is ``first draft'' quality. It works but may not adhere to ROOT coding or documentation conventions. There is also not-quite-a-bug regarding how the child frames are sized. This is due to me not yet understanding the theory of how TGFrames report and set their sizes (run test #7 and do a manual resize to see what I mean). Once these issues are settled I hope to get this into ROOT proper.

Browse the source here.

Get the source

Check the Makefile and build the source by just typing make.

To run the testing program do:

./test-gui <number> [ <number> ... ]
Where <number> is just one of the tests. In particular test #7 make a table with a bunch of buttons and a canvas.

Modifying ROOT

You will need to modify ROOT's gui/inc/TGLayout.h. Here is the output of `cvs diff TGLayout.h' showing the changes. They entail adding bits 8-11 to the ELayoutHints like:
 
enum ELayoutHints {
   kLHintsNoHints = 0,
   kLHintsLeft    = BIT(0),
   kLHintsCenterX = BIT(1),
   kLHintsRight   = BIT(2),
   kLHintsTop     = BIT(3),
   kLHintsCenterY = BIT(4),
   kLHintsBottom  = BIT(5),
   kLHintsExpandX = BIT(6),
   kLHintsExpandY = BIT(7),
   kLHintsNormal  = (kLHintsLeft | kLHintsTop),
   kLHintsShrinkX = BIT(8),
   kLHintsShrinkY = BIT(9),
   kLHintsFillX = BIT(10),
   kLHintsFillY = BIT(11)

};
and adding a virtual destructor:
    virtual ~TGLayoutHints() {}
to TGLayoutHints so that it can be subclassed. Last modified: Mon Apr 16 15:38:45 EDT 2001 ") ?>