ScriptedEvent "AddedChild" not fired during loadWindowLayout
Posted: Mon Feb 18, 2013 18:35
Hi,
I've written a simple window *.layout which defines a DefaultWindow (used as GUISheet) with two custom child widgets; see the pasted XML code below. For the main window I use two handlers for "AddedChild" and "RemovedChild" events. The problem I've encountered is as follows. When I load this layout (as a part of my Lua main script), then only the "RemovedChild" handler gets called, but --not-- the "AddedChild" event handler. It seems (for me) that during loadWindowLayout() no "AddedChild" events are fired ?!
I need these two events to perform some specific actions after a new child widget was added/removed to/from the main window.
Thanks for any help in advance!
==============================================
<GUILayout>
<Window Type="DefaultWindow" Name="Root">
<!-- Main window properties -->
<Property Name="UnifiedSize" Value="{{1,0},{1,0}}" />
<Property Name="MousePassThroughEnabled" value="True" />
<!-- Import NodeWidget layouts and create child nodes -->
<LayoutImport Filename="SensorNode.layout" Prefix="SNS_1" />
<LayoutImport Filename="SensorNode.layout" Prefix="SNS_2" />
<LayoutImport Filename="ActorNode.layout" Prefix="ACT_1" />
<!-- Scripted Events and handlers -->
<Event Name="AddedChild" Function="OnChildWindow_added" />
<Event Name="RemovedChild" Function="OnChildWindow_removed" />
</Window>
</GUILayout>
=========================================================
I've written a simple window *.layout which defines a DefaultWindow (used as GUISheet) with two custom child widgets; see the pasted XML code below. For the main window I use two handlers for "AddedChild" and "RemovedChild" events. The problem I've encountered is as follows. When I load this layout (as a part of my Lua main script), then only the "RemovedChild" handler gets called, but --not-- the "AddedChild" event handler. It seems (for me) that during loadWindowLayout() no "AddedChild" events are fired ?!
I need these two events to perform some specific actions after a new child widget was added/removed to/from the main window.
Thanks for any help in advance!
==============================================
<GUILayout>
<Window Type="DefaultWindow" Name="Root">
<!-- Main window properties -->
<Property Name="UnifiedSize" Value="{{1,0},{1,0}}" />
<Property Name="MousePassThroughEnabled" value="True" />
<!-- Import NodeWidget layouts and create child nodes -->
<LayoutImport Filename="SensorNode.layout" Prefix="SNS_1" />
<LayoutImport Filename="SensorNode.layout" Prefix="SNS_2" />
<LayoutImport Filename="ActorNode.layout" Prefix="ACT_1" />
<!-- Scripted Events and handlers -->
<Event Name="AddedChild" Function="OnChildWindow_added" />
<Event Name="RemovedChild" Function="OnChildWindow_removed" />
</Window>
</GUILayout>
=========================================================