Feb 14, 2012 at 6:25 PM
Edited Feb 14, 2012 at 6:31 PM
i just noticed something really weird.
my code looks something like this:
Screen mainScreen = new Screen( viewport.Width, viewport.Height );
guiManager.Screen = mainScreen;
topBar = new TopBar();
debugControlsWindow = new DebugControlsWindow();
mainScreen.Desktop.Children.Add( topBar );
as u can see, i'm directly adding the topBar to the screen, so it has index 0 in guiManager.Screen.Desktop.Children.
if i press the d key, the following line is executed:
guiManager.Screen.Desktop.Children.Add( debugControlsWindow );
so the debugControlsWindow has the index 1 in guiManager.Screen.Desktop.Children.
the window itself just consists of some labels, a button to close it and just to make this clear, one eventhandler wich listens for the buttonClickedEvent. and now comes the weird part: if i click any point in the debugControlsWindow the order in guiManager.Screen.Desktop.Children
gets turned upside down. wich means the topBar has index 1 and the debugControlsWindow index 0!
Why is this happening? could it be a bug?