Jump to content

Destroying container


wctltya

Recommended Posts

Hi guys,

I have a page container and inside of it have several children containers, for example ghPageContainer and ghChildContainer1, 2, etc. Each child container contains many elements, but especially ghChildContainer2 contains an ImageButton with properly stacked 3 images enabled/pressed/disabled and an ImageBox. The creation of the child containers are separated in functions as createChildContainerX(), because the child containers layouts and elements depends on an external data and I need to change them.

So when the shall be created the code looks like:

1. Create page container

2. createChildContainer1()

3. createChildContainer2(), etc.

But when I shall change the child containers contents, then the code looks like:

1. gwinDestroy(ghChildContainerX)

2.  createChildContainerX()

In the second case (destroy and create) the presentation of both ImageButton and Imagebox are wrong. The ImageButton is allays in enabled state and the image is overlapped with an white square.

But if I destroy the overall page (gwinDestroy(ghPageContainer)) and  recreate it, then all widgets are presented correct.

So, what could be the problem? Shall I do more things after a child container destruction before reconstruct it again?   

Link to comment
Share on other sites

  • 2 weeks later...

I've fixed this issue and here is how, might be useful for somebody else:

The main consideration is the show property while a child container is created. If it's parent is already shown, then the child container show property must be false during it's creation phase, then it can be shown. This way everything works fine.  

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...