K. Frank
2014-12-31 15:23:43 UTC
Hello List!
I wish to use some animation when tweaking the appearance
of a widget -- say, changing the color of a button.
If I use animateHide() followed by animateShow() on the same
widget, I see no animation in the browser. That is:
myWidget->animateHide (WAnimation (WAnimation::SlideInFromLeft));
// tweak widget
myWidget->animateShow (WAnimation (WAnimation::SlideInFromLeft));
looks the same as just
// tweak widget
(The widget's appearance changes, per the tweaks, but no animation
is apparent.) It's as if the animateHide() / animateShow() pair has
been optimized away.
If instead I have two copies of the widget, myWidgetA (initially shown)
and myWidgetB (with the tweaked appearance, but initially hidden),
then
myWidgetA->animateHide (WAnimation (WAnimation::SlideInFromLeft));
myWidgetB->animateShow (WAnimation (WAnimation::SlideInFromLeft));
shows the animation and gives the visual appearance I am looking for.
Is there a way to get animateHide() / animateShow() to work with a single
widget? Is there a better approach to get a similar effect?
Thanks.
K. Frank
I wish to use some animation when tweaking the appearance
of a widget -- say, changing the color of a button.
If I use animateHide() followed by animateShow() on the same
widget, I see no animation in the browser. That is:
myWidget->animateHide (WAnimation (WAnimation::SlideInFromLeft));
// tweak widget
myWidget->animateShow (WAnimation (WAnimation::SlideInFromLeft));
looks the same as just
// tweak widget
(The widget's appearance changes, per the tweaks, but no animation
is apparent.) It's as if the animateHide() / animateShow() pair has
been optimized away.
If instead I have two copies of the widget, myWidgetA (initially shown)
and myWidgetB (with the tweaked appearance, but initially hidden),
then
myWidgetA->animateHide (WAnimation (WAnimation::SlideInFromLeft));
myWidgetB->animateShow (WAnimation (WAnimation::SlideInFromLeft));
shows the animation and gives the visual appearance I am looking for.
Is there a way to get animateHide() / animateShow() to work with a single
widget? Is there a better approach to get a similar effect?
Thanks.
K. Frank