[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

#### 4.19.9.4 Widget Setup Nodes

Some widgets may need a little more complex setup than is common. To accomodate this situation, widgets also have an optional setup node that can be used to provide custom widget initialization.

    <widget type="Label" id="pauseDescLabel">
    	<setup>
    			<![CDATA[

    				Sys.Print("Setting up label...");
    				pauseDescLabel.text = "Pause the particle fountain.";

    			]]>
        </setup>
    </widget>

The body of the setup node is executed in place. You can do anything you want inside of it.

Notice that we used a CDATA construct. While this isn't necessary, it may make your life easier if you are doing relational operations.

Note: It is not necessary to give the widget an id in order to use setup. Instead, you may use the variable "widget" to refer to the widget. This is only available in the setup node.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ]

This document was generated using texi2html 1.76.