<?xml version="1.0" encoding="utf-8"?>
<wx:App xmlns:wx="http://www.pulp.se/wxwML/0.3/">

	<!--
		The wxwML will be evaluated as follows:
			step 1: create and bind references to all wx objects
			step 2: make post creation calls such as add child elements to
				sizers, set default values etc.
			step 3: make function calls
	-->

	<wx:Frame name="Frame1" parent="None" title="My Frame"
		style="wx.DEFAULT_FRAME_STYLE">
		<!--
			A Sizer will automatically be added to it's parent with
			parent.SetSizer(sizer) in step 2.
		-->
		<wx:BoxSizer name="BoxSizer1" orient="wx.VERTICAL"
			add.flag="wx.ALIGN_LEFT | wx.EXPAND | wx.ALL" add.border="0">
			
			<wx:Panel name="Panel1" parent="Frame1">
				<wx:BoxSizer name="BoxSizer2" orient="wx.VERTICAL"
					add.flag="wx.ALIGN_LEFT | wx.EXPAND | wx.ALL" add.border="0">
					<!--
						All wxObject child elements will be added to the
						sizer using sizer.Add(child) in step 2. The attributes
						add.flag and add.border will be used as keyword
						arguments.
					-->
					<wx:StaticText name="StaticText1" label="Text"
						style="wx.ALIGN_LEFT" />
					
					<wx:TextCtrl name="TextCtrl1" size="(200, 200)"
						style="wx.TE_MULTILINE">
						<string>Lorem "ipsum" &amp; dolores sit amet!</string>
					</wx:TextCtrl>
					<!--
						The above is equal to the following:
						
						<wx:TextCtrl name="TextCtrl1"  size="(200, 200)"
							style="wx.TE_MULTILINE"
							value="Lorem &quot;ipsum&quot; &amp; dolores sit amet!" />
							
						NOTE! &amp;, &quot;, &gt; and &lt; is changed into &,
						", > and < when it's sent to wxWidgets.
						
						NOTE! The argument size="(200, 200)" will be treated
						"as is"	(the sandbox gets it as size= (200, 200))
						which will convert (200, 200) into a python tuple
					-->
					<wx:StaticText name="StaticText2" label="Number"
						style="wx.ALIGN_LEFT" />
					
					<wx:Choice name="Choice1">
						<list>
							<value>1</value>
							<value>2</value>
							<value>3</value>
						</list>
						<!--
							List element creates a python list object
							containing each of the values specified.
							
							NOTE! The order of items in the resulting list
							may differ from the wxwML, AFAIK they don't but
							don't count on it!
							
							NOTE! The above could also have been written as
							<wx:Choice name="Choice1" choices="[1,2,3]">
							which would guarantuee the ordering of items in
							the list
						-->
						
						<call function="SetSelection" argument="0" />
						<!--
							Arguments to a function will be tried as follows:
								1: use attribute "argument" as single,
									non-keyword, argument
								2: add child elements (wrapped in argument
									elements with name attribute) as keyword
									arguments
									NOTE! name is optional if there's only
									one argument element!
								3: add non-private attributes as keyword
									arguments
								4: call function without arguments
								
							The above is equal to the following:
							
							<call function="SetSelection">
								<argument>
									<integer>0</integer>
								</argument>
							</call>
						-->
					</wx:Choice>
					
					<wx:Button name="Button1" label="PRESS ME!">
						<bind event="wx.EVT_BUTTON"
							handler="sample2.xml"
							source="Button1" />
						<!--
							Bind/Unbind creates a handler function that reads
							and	evaluates the response from the specified
							handler (URL)
							
							NOTE! Arguments are handled in the same way as
							calls except that if name is not specified the
							default	object name will be used
						-->
					</wx:Button>
					
				</wx:BoxSizer>
			</wx:Panel>
			
		</wx:BoxSizer>
	</wx:Frame>
	<!--
		The frame.Fit() and frame.Show(True) methods are automatically
		called on Frames (and Dialogs) in step 2.
	-->
</wx:App>

