TButton: allow to get/set the action
[fanfix.git] / src / jexer / TWidget.java
index 60bc3e4a618c0cce09d84cbdbedfdc200da39906..e11a947687027b4da7de59b10d51f1542ea54342 100644 (file)
@@ -935,8 +935,9 @@ public abstract class TWidget implements Comparable<TWidget> {
 
         this.x = x;
         this.y = y;
-        this.width = width;
-        this.height = height;
+        // Call the functions so that subclasses can choose how to handle it.
+        setWidth(width);
+        setHeight(height);
         if (layout != null) {
             layout.onResize(new TResizeEvent(TResizeEvent.Type.WIDGET,
                     width, height));
@@ -1367,7 +1368,7 @@ public abstract class TWidget implements Comparable<TWidget> {
      *
      * @param child TWidget to add
      */
-    private void addChild(final TWidget child) {
+    public void addChild(final TWidget child) {
         children.add(child);
 
         if ((child.enabled)