fix dumb crash with dynamically initialized widgets

This commit is contained in:
Chris Forbes
2010-03-16 19:19:41 +13:00
parent f13ebcc0d2
commit 9290065ff9

View File

@@ -24,7 +24,9 @@ namespace OpenRA.Widgets
// Calculated internally
public Rectangle Bounds;
public Rectangle EventBounds;
public Widget Parent = null;
public Widget Parent = null;
public Widget() { InputHandler = Lazy.New(() => BindHandler(Delegate)); }
public virtual void Initialize()
{
@@ -54,8 +56,6 @@ namespace OpenRA.Widgets
child.Initialize();
EventBounds = Rectangle.Union(EventBounds, child.EventBounds);
}
InputHandler = Lazy.New(() => BindHandler(Delegate));
}
static IWidgetDelegate BindHandler(string name)