2 Replies Latest reply on Sep 20, 2006 12:54 PM by peterent

    Performance Absolute Positioning vs. HBox / VBox

    blomasky Level 1
      While it is very easy to layout my screen using a few (2-4) nested VBox and HBox, My question is what am I losing in performance (and code size) by doing this vs. using the X and Y coordinates?

      thanks
      bruce
        • 1. Re: Performance Absolute Positioning vs. HBox / VBox
          inlineblue Level 1
          It's really only a concern if you've got a LOT of them on the screen. 4 Box containers versus 1 Canvas is pretty negligible in terms of layout time. I've got an app that has maybe 10-15 containers on screen at any time, and there's no noticeable lag.
          • 2. Re: Performance Absolute Positioning vs. HBox / VBox
            peterent Level 2
            Also keep in mind what containers like Panel and TitleWindow do for you. For example, I have seen many times people adding a VBox or a Canvas to a Panel without realizing that a Panel can act as either container (using its layout property). That extra level is not necessary.

            Also don't use a Container and have just 1 child - another overhead that isn't useful unless you are dynamically adding children to the container or planning to expand the application later.