Container Control - Open Event

  1. ‹ Older
  2. 4 weeks ago

    Bob K

    Nov 14 Pre-Release Testers, Xojo Pro Kansas City

    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.

  3. Dave S

    Nov 14 San Diego, California USA

    @Bob K 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 .... :)

    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.

  4. Bob K

    Nov 14 Pre-Release Testers, Xojo Pro Kansas City

    Subclassed container or just straight container?

  5. Dave S

    Nov 14 San Diego, California USA

    @Bob K straight container

  6. Bob K

    Nov 14 Pre-Release Testers, Xojo Pro Kansas City

    Huh. I'm out of guesses.

  7. Dave S

    Nov 14 San Diego, California USA

    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.... :(

  8. Bob K

    Nov 14 Pre-Release Testers, Xojo Pro Kansas City

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

  9. Dave S

    Nov 14 San Diego, California USA

    @Bob K 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

  10. Jon O

    Nov 14 Pre-Release Testers, Xojo Pro Chicago Area USA

    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.

  11. Tim P

    Nov 14 Pre-Release Testers feedback://46303

    @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

    Is it small enough to share with us then? I'm curious

  12. Dave S

    Nov 14 San Diego, California USA

    @Jon O Are you placing the container in the window

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

    @Tim P Is it small enough to share with us then? I'm curious

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

  13. Jon O

    Nov 14 Pre-Release Testers, Xojo Pro Chicago Area USA

    @Dave S the Container is the basis for a custom control... one that needs to ultmatly be used over and over again.

    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.

  14. Dave S

    Nov 14 San Diego, California USA
    Edited 4 weeks ago

    @Jon O 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

  15. Jon O

    Nov 14 Pre-Release Testers, Xojo Pro Chicago Area USA

    Is it possible that by calling Resize, it then keeps calling Resize? I've made that mistake many a time. Solved it by putting in a variable to check if Resized has been called and if so then I don't call it again...

  16. Jason P

    Nov 14 Xojo Inc Texas

    @Dave S 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 :(

    A containers open event only fires when it's embedded unless it's an instance placed on a layout at design time.

  17. Dave S

    Nov 14 San Diego, California USA
    Edited 4 weeks ago

    @Jason P unless it's an instance placed on a layout at design time.

    this is what it is

    I created the Custom Control... drag it to the window, run the app

  18. Dave S

    Nov 14 San Diego, California USA

    guess next step is to clone the project, and start removing CP varaibles to see if it "works" again at some point, then reverse that process

  19. Dave S

    Nov 14 San Diego, California USA

    well spoke too soon.... that was the issue that caused the hang up... but not what aborted the OPEN events...

  20. 2 weeks ago

    Jon O

    Dec 1 Pre-Release Testers, Xojo Pro Chicago Area USA

    Dave,

    Here's the case I was thinking of. It turns out that for multiple instances of the same object (ie: control array), that Open fires before the constructor on each new item.

    Feedback Case #26254

    Maybe this is similar to your problem?

or Sign Up to reply!