[comp.windows.interviews] TBBox problem from Jun Rekimoto

sung@rigel.csc.ti.com ("Helen Chang ", sung@csc.ti.com) (06/27/91)

   > Jun Rekimoto said,
   > I have found a little trouble with TBBox. I want to get a layout such as:
				
      +++++++ ++++++++++++++++++++
      +     + +                  +
      +  A  + +                  +
      +     + +                  +
      +++++++ +                  +
      +++++++ +                  +
      +     + +       C          +
      +  B  + +                  +
      +     + +                  +
      +++++++ +                  +
              +                  +
              +                  +
              ++++++++++++++++++++


You can achieve your target layout using VCenter, such as used in the modified
program below.  Please refer to Paul Calder's message date 14 Jun 91 on 
"Subject: Re: Glyph: :request()"

Helen Chang


====================================================================

#include <InterViews/background.h>
#include <InterViews/border.h>
#include <InterViews/box.h>
#include <InterViews/center.h>
#include <InterViews/font.h>
#include <InterViews/glue.h>
#include <InterViews/label.h>
#include <InterViews/margin.h>, 1.0)
#include <InterViews/window.h>
#include <InterViews/world.h>

int main(int argc, char** argv) {	        	 
    World world("Test", argc, argv);	        	 
    Color* fg = world.foreground();	        	 
    Color* bg = world.background();	        	 
    Font* f   = world.font();	        	 
    		    			        	 
    Glyph* A = new Border(
		   new Margin(
		       new LRBox(new Label("BOX A", f, fg),
				 new TBBox(new VGlue(1.0*inch))),
		       0.2*inch),
		   fg, 0.1*inch);
    Glyph* B = new Border(
		   new Margin(
		       new LRBox(new Label("BOX B", f, fg),
				 new TBBox(new VGlue(1.0*inch))),
		       0.2*inch),
		   fg, 0.1*inch);
    Glyph* C = new Border(
		   new Margin(
		       new LRBox(new Label("BOX C", f, fg),
				 new TBBox(new VGlue(3.0*inch))),
		       0.2*inch),
		   fg, 0.1*inch);
		    			        	 
    Glyph* top = new Background(new LRBox(new VCenter(new TBBox(A, B),1.0),
					  new VCenter(C,1.0)
				    ), bg);
    		    			        	 
    Window* w = new ApplicationWindow(top);  
    w->map();	    			     
    world.run();    			     
    return 0;	    			     
}