504 views
in GUI Development by

Hello,

I need to create a component that is loaded into memory and unloaded using a fading effect.

To load the component, there is no problem, I declared it, with the "Opacity" property set to 0, and used an Int32Effect from 0 to 255 to make it appear while charged into the memory.

My problem is the other way around, before deleting it from memory, I reused my effect (from 255 to 0 this time), but the component is always deleted before the effect is even done.

I tried with the postsignal process to wait for the effect, but in that case, I have the following error message:

[8.11.2018  9:16:19] Runtime Core::Group.Remove (2:3) : Chora exception: 'No view to remove'.

Here is my code for the component removal:

  // If the element is loaded and should not be, then we delete it
else if(!ActiveDisplay && this.Screen_Logo != null)
{
  var slot EffectEnding = this.Effect_ScrOpacity.OnFinished;

    // We set & activate the opacity effect
  this.Effect_ScrOpacity.Outlet = ^this.Screen_Logo.Opacity;
  this.Effect_ScrOpacity.OnFinished = this.Slot_ScrLogoOpacityOff;
  this.Effect_ScrOpacity.Value1 = this.iOpacityMax;
  this.Effect_ScrOpacity.Value2 = this.iOpacityMin;
  this.Effect_ScrOpacity.Enabled = true;

  postsignal EffectEnding;

  //  // The removal of the screen itself will be launched at the end of the effect
    // We remove the logo screen from memory
  Remove(this.Screen_Logo);
  this.Screen_Logo = null;
}

Thank you for the help,

Krzysztof,

1 Answer

0 votes
by

Hello Krzysztof,

from the above source code you start the effect and immediately after this step you remove the component without waiting for the end of the effect. My suggestion: from your actual implementation delete the following two rows and put them inside the slot method Slot_ScrLogoOpacityOff:

Remove(this.Screen_Logo);
this.Screen_Logo = null;

Accordingly, the component is deleted not before the effect is finished.

Hopefully it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...