Using Layouts In Qooxdoo - Part 1
The answer is “No”, to the question above. You don’t create DOM elements with qx (unless you are doing something really exotic). Actually you don’t need to concern yourself with the DOM at all. GUI is abstracted to a set of intuitive classes that you should be familiar from today’s desktop operating systems. This abstraction brings two big advantages:
- Developers using qx don’t need to concern themselves with cross-browser issues.
- Theming is easy and uniform.
Widgets Are The Building Blocks
A qx user interface is constructed using widgets. A widget is a class that encapsulates appereance, data and behaviour. For instance a TextField would render itself as a box and a caret, make the text you enter inside accessible programmatically and allow you to be notified whenever a the text data is changed. Widgets are customizable, subclassable and of course themable.
But a GUI hardly ever consists of a single widget. Instead there is a hierarchy of widgets. A container is a special kind of widget that has child widgets. A container widget ususally doesn’t have any visual parts itself and just render its children in its screen space. How child widgets are positioned within their container is decided by the container’s layout manager. Having a layout manager means the abstraction of layout strategy for maximum flexibility.
- Qx GUI’s are hierarchically constructed from widgets.
- Each application has a root container.
- Each container has a layout manager and one or more child widgets2.
- A child of a container can be either:
- Another container.
- Or a control widget (such as a form widget).
NEXT PART: VBox Layout
1: You might want to see Qooxdoo - API documentation instead.
2: Although it is possible that a container may have no children, it is not sensible.
If you have any questions, suggestions or corrections feel free to drop me a line.