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

[Sc-devel] SCTextView problem with SCWindow-scroll and FlowLayout



Hi list,

There seems to be a problem when using a SCTextView with SCWindow-scroll and FlowLayout:

// OK - with scroll: true but no decorator, the SCTextView is correctly drawn at the position given by the SCTextView's bounds argument.
(
w = SCWindow("Window 1 - ok", Rect(30, 300, 300, 300), scroll: true);
w.front;
SCStaticText(w, Rect(10, 10, 100, 20)).background_(Color.black);
SCTextView(w, Rect(100,100, 100,100)).background_(Color.red).string_("sjkdf sjkldf");
)

// OK - with scroll: false and with a decorator, the SCTextView is correctly drawn at the position controlled by the decorator.
(
w = SCWindow("Window 2 - ok", Rect(30, 300, 300, 300), scroll: false);
w.view.decorator_(FlowLayout(w.view.bounds));
w.front;
SCStaticText(w, Rect(10, 10, 100, 20)).background_(Color.black);
SCTextView(w, Rect(100,100, 100,110)).background_(Color.red).string_("sjkdf sjkldf");
)

// PROBLEM - with scroll: true and with a decorator, the SCTextView is correctly drawn at the right position controlled by the decorator. 
// However, a second version (without the text string) is incorrectly drawn at the position given by the SCTextView's bounds argument, which is usually ignored when a decorator is used.  
(
w = SCWindow("Window 3 - problem", Rect(30, 300, 300, 300), scroll: true);
w.view.decorator_(FlowLayout(w.view.bounds));
w.front;
SCStaticText(w, Rect(10, 10, 100, 20)).background_(Color.black);
SCTextView(w, Rect(100,100, 100,110)).background_(Color.red).string_("sjkdf sjkldf");
)

Cheers,

Paul

P.S. Thanks for all the work on the latest release.