ggeorg / gwt-mosaic

Automatically exported from code.google.com/p/gwt-mosaic
1 stars 0 forks source link

Bug in the Application.Launch() method #87

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

In the Application.launch() method
the initialize(), startup() and ready() method are called sequencially. 
This doesn't work as intended (I presume). I noticed that when I create a new 
WindowPanel in the ready() method the parent 'boundary' panel doesn't have an 
initial size. The code below solves this problem.
So, a possible sollution might be to replace the original DeferredCommand with:
        /*
         * Call initialize(), startup() and ready() ...
         */
        DeferredCommand.addCommand(new IncrementalCommand() {

            private int cnt = 0;

            public boolean execute() {
                switch (cnt) {
                    case 0:
                        Application.application.initialize();
                        break;
                    case 1:
                        Application.application.startup();
                        break;
                    case 2:
                        Application.application.ready();
                        break;
                    default:
                        return false;
                }
                cnt++;
                return true;
            }
        });

(For the rest, thanks for your wonderfull code!)

With kind regards,

Coen Blijker
c.blijker-at-crcvalue.nl

Original issue reported on code.google.com by c.blijke...@gmail.com on 5 Jan 2011 at 9:15