Best to add WebContainers in IDE or Embed?

  1. 3 months ago

    David C

    Sep 15 Pre-Release Testers, Xojo Pro Derby, ITM

    I have lots of containers within containers dragged within the IDE into my WebPages. Normally this is OK as I edit one WebContainer at a time, but if I open the main WebPage (even with no other tabs or projects open) the IDE becomes like molasses.

    If instead, I define a myWebContainer as a WebPage Property then, in the Open Event, set this Property to New ccMyWebContainer and myWebContainer.EmbedWith(Self, …,…) onto my WebPage the IDE is much more responsive, and the WebApp works just fine.

    But… am I creating two versions of the WebContainer (one in the Property and one embedded on the Web Page) thus doubling the memory requirements? Or does embedding a WebContainer Property all point to the one WebContainer, so all is well?

    That property is just a reference, and you’ll Want to keep it around unless you’re closing the container. Then you’ll set it to Nil.

  2. Anthony C

    Sep 15 Pre-Release Testers, Xojo Pro, Third Party Store GraffitiSuite Developer

    If you still have the one dragged in to the IDE on the page, then yes, you're creating two. Once you have your positioning worked out and you're using EmbedWithin, there's really no reason to keep the original ContainerControl on the view.

  3. David C

    Sep 15 Pre-Release Testers, Xojo Pro Derby, ITM
    Edited 3 months ago

    No, it is an either/or system I am looking for. When I created the WebContainer Properties, I removed the dragged-on versions.

    I would prefer to create and Embed the WebContainers at runtime (all being equal) since it will make the IDE much faster for me, and I can still write code to those WebContainers (as Properties).

    Once I create and embed the WebContainer on the WebPage in the Open Event, should I set the WebContainer Property back to nil to save RAM?

  4. Anthony C

    Sep 15 Pre-Release Testers, Xojo Pro, Third Party Store Answer GraffitiSuite Developer
    Edited 3 months ago

    That property is just a reference, and you’ll Want to keep it around unless you’re closing the container. Then you’ll set it to Nil.

  5. David C

    Sep 15 Pre-Release Testers, Xojo Pro Derby, ITM

    Great! This will make my IDE much faster, my apps much smaller to save, and the WebApp not use double the memory.

or Sign Up to reply!