[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sc-devel] bugs in SCxxxLayoutView




Am 09.02.2008 um 01:28 schrieb Jan Trutzschler:

E.G.  the "elastic" example in SCHLayoutView help file works, but the
background color is _not_ elastic.

fixed that one, can you find another one ? 8-)


Not sure, at least here is an example where it behaves differently than other views under certain conditions.

Sorry, there is some nested flowing going on here.
The blue thing should be inside the white rect at the top.

Setting "ct.relativeOrigin" to true breaks the layout; but it breaks differenly for the slider than for the layout view, weird. Thanks anyway.



(
var win, cntnr, makeBlueInWhite;

win = GUI.window.new("placement", Rect(100, 100, 400, 300));
win.view.decorator = FlowLayout(win.view.bounds, 20 @ 20, 20 @ 20);
win.view.relativeOrigin = true;

cntnr = GUI.compositeView.new(
	win,
	win.view.bounds.width * 0.8 @ (win.view.bounds.height * 0.8)
);
cntnr.decorator = FlowLayout(cntnr.bounds, 10 @ 10, 10 @ 10);
cntnr.relativeOrigin = true;
cntnr.background = Color.gray;

makeBlueInWhite = { |parent|
	var ct, what;
	ct = GUI.compositeView.new(parent, 200 @ 100);
	ct.decorator = FlowLayout(ct.bounds, 0 @ 0, 0 @ 0);
	ct.background = Color.white;
		
		// change this:
	ct.relativeOrigin = false;	
		// then compare:
	what = GUI.hLayoutView.new(ct, ct.bounds.width @ 20);
//	what = GUI.slider.new(ct, ct.bounds.width @ 20);

	what.background = Color.blue(1.0, 0.4);
};

makeBlueInWhite.value(cntnr);

win.front;
)