WTemplate [doc]

A WTemplate is a widget which displays an XHTML fragment in which other widgets or strings may be bound. This is especially useful as an alternative to a container widget if you want to use CSS for style and layout, and the contents is well specified (i.e. not dynamic).

In a template, ${var} indicates a place holder which is substituted with a widget or string that is bound to the template.

The template text can be provided by a WString and is thus easily localized and internalitionalized using a message resource bundle.

Below is an example of a template:


<div class="form">
<p>
<label>Please enter your name: ${name-edit}</label>
</p>
<p>
${save-button} ${cancel-button}
</p>
</div>

When instantiated and bound using a WLineEdit and two WPushButtons, this becomes:

Events will be shown here.