From 35b1874b53e81e93aea42f146decc138c71ca0d1 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Thu, 24 Oct 2019 08:35:32 +0200 Subject: [PATCH] fix parentless commit --- src/jexer/TWidget.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index 32b5598..f11cbf3 100644 --- a/src/jexer/TWidget.java +++ b/src/jexer/TWidget.java @@ -208,20 +208,9 @@ public abstract class TWidget implements Comparable { } this.enabled = enabled; + this.parent = parent; children = new ArrayList(); - // Allow parentless widgets - if (parent != null) { - // Do not add TStatusBars, they are drawn by TApplication. - if (this instanceof TStatusBar) { - // We don't add the child to the children list here - this.parent = parent; - this.window = parent.window; - } else { - parent.addChild(this); - } - } - this.x = x; this.y = y; this.width = width; @@ -1375,8 +1364,6 @@ public abstract class TWidget implements Comparable { */ private void addChild(final TWidget child) { children.add(child); - child.parent = this; - child.window = this.window; if ((child.enabled) && !(child instanceof THScroller) -- 2.27.0