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

Re: [Sc-devel] bugs in SCxxxLayoutView



thanks, fixed now too ..


On Feb 9, 2008, at 1:30 PM, Stephan Wittwer wrote:

Simpler (just uncomment), regards

(
var win, gray, white, blue;

win = GUI.window.new("win", Rect(100, 100, 400, 300));
win.view.relativeOrigin = true;

gray = GUI.compositeView.new(win, Rect(40, 30, 300, 200));
gray.relativeOrigin = true;
gray.background = Color.gray;

white = GUI.compositeView.new(gray, Rect(20, 20, 200, 100));
white.relativeOrigin = true;
white.background = Color.white;

blue = GUI.slider.new(white, white.bounds.width @ 20);
//blue = GUI.hLayoutView.new(white, white.bounds.width @ 20);
blue.background = Color.blue(1.0, 0.4);
win.front;
)




Am 09.02.2008 um 12:47 schrieb Stephan Wittwer:


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;
)
_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel

_______________________________________________
Sc-devel mailing list
Sc-devel@xxxxxxxxxxxxxxx
http://lists.create.ucsb.edu/mailman/listinfo/sc-devel