Container Control - Open Event

I created a custom control using a Container Control to hold all the bits.
To the CC I added Open and Resize events…
The Resize event is called as desired… but the Open event is NEVER called… I even put breakpoints to be sure.
If I add an Activate event… it is called, but not the Open…

Constructor method is called, so maybe I will use that unless someone can tell me I did something wrong :frowning:

As a workarround you could use the Contructor to raise you own open event.

I tried that… and all of a sudden the app just crashes… not related to Constructor , or I think it isn’t

so now I have to figure out the crash before I can readdress this… and everything WAS working so well :frowning:

You must be doing something weird. Of course, the open even of containers fire.

That goes with out saying :slight_smile:

I think it has something to do with the computed properties … since all those get called BEFORE the open event even

I did something similar last week. App started crashing when closing the database. Stupid me had added a disconnect and then the app talked to the database again. Took me quite a while to understand what I had done.

a few of the computed properties were told to invalidate a canvas… which wasn’t ready yet.

Why it just “skipped” the Open event instead of raising an error I do not know

If memory serves (and it doesn’t always), the Open event is the last thing that fires indicating that everything is done and ready for business. In the open event set a boolean variable for Initialized and in your computed properties you might want do a check that variable before sending commands to controls.

Yeah that is what I’m working on right now… something I just changed has it going into an infinite loop… if it isn’t one issue its another … :slight_smile:

And it has to be something with the Computed Properties… as I have found it is skipping the Open events of all the controls that are INSIDE the CC as well.

Subclassed container or just straight container?

Huh. I’m out of guesses.

I put log messages into every event and method… and it shows that all the CP are activated… but then nothing… it doesn’t log anything past that… :frowning:

Break it out into a smaller project to see if it’s something specific to the larger one?

Ironically this isn’t a large project by any means…

Its a window and this one CC with a Textarea , 3 canvas and a Label

I have seen this where a Container’s open event never fires. I know I’ve seen it in WebContainers, but I think in Desktop as well. I believe I may have an open bug report on this - I’ll have to look.

Question: Are you placing the container in the window or are you creating the container and using EmbedWithin

I think that placing it in the window in the IDE is problematic. I now embed my containers in code 100% of the time. In those cases, the open event seems to fire reliably.

[quote=414259:@Dave S]Ironically this isn’t a large project by any means…

Its a window and this one CC with a Textarea , 3 canvas and a Label[/quote]
Is it small enough to share with us then? I’m curious

the Container is the basis for a custom control… one that needs to ultmatly be used over and over again

I’d rather not quite yet… if I get it working, it will be a simple alternative to CEF, FTC etc.

OK. So you are embedding it. That’s strange. Check for some sort of exception in the Constructor or in one of the controls in the container. I’ve seen that which then aborts the constructor code from running and the Open event never gets called.

Ok… it seems to get thru all the initialization stuff… and calls RESIZE on the Window… then goes into a loop
it says it exited RESIZED