HelloWorld
HelloWorld

Reputation: 2355

What's the use of the layout managers in the (new) GUI Builder of Codename One?

I am trying to create a new project with the new GUI BUilder (I've already made hand-coded project). I watched Steve Hannah's tutorial about creating a sign-in form. If the sign-in form was hand-coded then it would have to use eg a Y-BoxLayout Manager. However in the tutorial everything is laid-out without resorting explicitly to this layout manager what I understand because the designer provides the layout.

But I wonder why new the GUI Builder offers such containers with specific layout managers ? What are the use cases when they should be used, and are they meant to be used as is (as ready-to-use examples) or the designer should remove the components inside with custom ones ?

Thanks in advance for the shed lights ;-)

Upvotes: 1

Views: 39

Answers (1)

steve hannah
steve hannah

Reputation: 4716

The current version (3.7.2 and earlier) works best with a flat layout (i.e. not nesting subcontainers). The next release will include improvements that make it easier to work with nested layouts.

There are many reasons why you might want to use a nested layout. A couple of use-cases that come to mind are:

  1. If you're laying out a form that has more than one logical section and you want to be able to lay them out independently. In this case using a couple of sub-containers that both use LayeredLayout themselves can make things a little easier.
  2. If the layout has a nested list (i.e. box-layout-y) that you will populate in code at runtime with content that you load from a web-service, etc..

Upvotes: 2

Related Questions