kernahr5 wrote:Does anyone know how to get round this so code start going in the createContents method by default
The problem here is that the Designer can't read your mind in the absence of any other information. It's not putting the code in the "wrong" method, because there is no defined standard here. The createContents() method is used in some cases, but it a fairly weak convention at best.
When the Designer looks at a class, it tries to determine the default method in which to generate code. That method will generally be the one where the other existing widgets are generated. If there aren't any existing widgets, it will look to the method that defines the main container used for the layout. In the case of a Composite, that would be the constructor. Once you actually refactored the class to place the widget definitions into the createContents() method, it could identify that as the primary target method and place any new widgets there. Fortunately, the Designer does not force you into a specific pattern, and will allow you to refactor the code to make changes like this.