Page 1 of 1

Multiple Children

Posted: Tue Jul 05, 2005 02:21
by tonyhnz
I have the following XML layout ..

Code: Select all

<?xml version="1.0" ?>
<GUILayout>

<Window Type="TaharezLook/FrameWindow" Name="/Chat">
   <Property Name="Position" Value="x:0.0 y:0.0" />
   <Property Name="Size" Value="w:0.25 h:0.25" />
   <Property Name="Alpha" Value="0.6" />
   <Window Type="DefaultWindow" Name="/Chat/Wnd">
        <Property Name="InheritsAlpha" Value="True" />
      <Property Name="Position" Value="x:0.0 y:0.00" />
      <Property Name="Size" Value="w:1 h:1" />
      <Window Type="TaharezLook/Listbox" Name="/Chat/Wnd/List">
         <Property Name="Position" Value="x:0.0 y:0.1" />
         <Property Name="Size" Value="w:1 h:0.77" />
           <Property Name="InheritsAlpha" Value="True" />
         <Property Name="ReadOnly" value = "True" />
      /Window>
       <Window Type="TaharezLook/Editbox" Name="/Chat/Wnd/Edit" >
         <Property Name="Position" Value="x:0.01 y:0.87" />
         <Property Name="Size" Value="w:0.98 h:0.12" />
           <Property Name="InheritsAlpha" Value="True" />
      /Window>
   </Window>
</Window>
</GUILayout>


Now I wanted /Chat/Wnd/Edit to be also be a child of /Chat/Wnd - instead it gets attached to /Chat/Wnd/List.
I have worked around it in the code for now but is there a way to set it correctly from the xml ?

Re: Multiple Children

Posted: Tue Jul 05, 2005 07:48
by CrazyEddie
Hi,

your closing </Window> tags are missing the '<' so each window block is not terminated correctly, causing subsequent window to be added to the wrong place.

Since validation did not catch it, I guess you're using tinyXML, right? :)

Re: Multiple Children

Posted: Tue Jul 05, 2005 13:51
by tonyhnz
Yes i am using tinyxml. I looked and looked at the xml and never noticed the missing '<'.
Needed a second set of eyes to spot the obvious.

I have got the basics of the chat box working pretty well - you press enter in the edit box and the text appears in listbox above. Also have it scrolling the list lines up - it was pretty straight forward to code.
I am in process of adding code to wiki.