🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #146

probable iv-3.1beta bug in box alignment

#146
From: Steven McCanne
Date: Fri, 31 Jul 1992 23:56
45 lines
2035 bytes
I ran into trouble with the alignment of items within a vbox.
If I put something in a glyph vbox, with stretchable glue above and
below it, the glyph appears at the bottom of the box and is rigid.
I would think the box would be non-rigid and the glyph centered.  The 
same problem doesn't seem to materialize with hboxes.

You can reproduce the problem with the example program in
iv/src/examples/circle/main.c.  Change main() to the following:

int main(int argc, char** argv) {
    Session* session = new Session("Himom", argc, argv);
    WidgetKit& kit = *WidgetKit::instance();
    const LayoutKit& layout = *LayoutKit::instance();

    PolyGlyph* p;
#ifdef VERTICAL
    p = layout.hbox(layout.vglue(5 * 70),
		    layout.vbox(layout.vglue(),
				new Circle(100, kit.foreground(), 
					   new Brush(1.0)),
				layout.vglue()));
#else
    p = layout.vbox(layout.hglue(5 * 70),
		    layout.hbox(layout.hglue(),
				new Circle(100, kit.foreground(), 
					   new Brush(1.0)),
				layout.hglue()));
#endif
    session->run_window(
	new ApplicationWindow(
	    new Background(p, kit.background())
	)
    );
}

When compiled without -DVERTICAL, the horizontal version works as expected.
You can resize the window and the circle appears in the middle.  But
with -DVERTICAL, the circle is at the bottom of the window, and the
window is rigid.  I think the problem is in Align::request(), since
it seems to be setting "result" incorrectly from Superpose::request().

I tried to fix it but I don't really understand the six parameter version
of the Requirement constructor.

Steve
Technical Details
Message-ID: <9207312356.AA24560@horse.ee.lbl.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!HORSE.EE.LBL.GOV!mccanne

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!HORSE.EE.LBL.GOV!mccanne
From: mccanne@HORSE.EE.LBL.GOV (Steven McCanne)
Subject: probable iv-3.1beta bug in box alignment
Message-ID: <9207312356.AA24560@horse.ee.lbl.gov>
Sender: news@shelby.stanford.edu (USENET News System)
Organization: Internet-USENET Gateway at Stanford University
Date: Fri, 31 Jul 1992 23:56:54 GMT
Lines: 46