ScrollView in Qt - setting visibleOrigin doesn't work unless deferred #823
Labels
bug
Issues that relate to unexpected/unwanted behavior. Don't use for PRs.
comp: Qt GUI
sclang Qt components -- for IDE tickets, use "env: SCIDE" instead
fix proposed
Milestone
(Found using SC 3.6.3 with Qt on OS X 10.7.4.)
Setting visibleOrigin doesn't work unless you defer a bit after the view is created .
EXAMPLE CODE:
(
// Window 1 -
w = Window.new("visibleOrigin not updated", Rect(10, 700, 400, 400)).front;
b = ScrollView(w, Rect(0, 0, 300, 300)).hasBorder_(true);
c = CompositeView(b, Rect(0, 0, 500, 500)); // 'canvas' is this big
c.decorator = FlowLayout(c.bounds); // now we can use a decorator
Slider2D(c, Rect(0, 0, 240, 240));
Slider2D(c, Rect(0, 0, 240, 240));
Slider2D(c, Rect(0, 0, 240, 240));
c.decorator.nextLine;
w.front;
b.visibleOrigin = Point(50,50);
// Window 2 -
w = Window.new("visibleOrigin is updated", Rect(610, 700, 400, 400)).front;
b = ScrollView(w, Rect(0, 0, 300, 300)).hasBorder_(true);
c = CompositeView(b, Rect(0, 0, 500, 500)); // 'canvas' is this big
c.decorator = FlowLayout(c.bounds); // now we can use a decorator
Slider2D(c, Rect(0, 0, 240, 240));
Slider2D(c, Rect(0, 0, 240, 240));
Slider2D(c, Rect(0, 0, 240, 240));
c.decorator.nextLine;
w.front;
{b.visibleOrigin = Point(50,50);}.defer(0.01);
)
The text was updated successfully, but these errors were encountered: