X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTWidget.java;h=d48ffe4c9ad6e477123c1e940e659360b347a1ab;hb=fc2af49443133106c95da9aaf8b7126be8c7dedd;hp=9dd21c1a08e9fa18d341fe310f7d1ac1c9aa894e;hpb=8f62f06e3ab03e24e23a1b7f369ae31d701e736b;p=fanfix.git diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index 9dd21c1..d48ffe4 100644 --- a/src/jexer/TWidget.java +++ b/src/jexer/TWidget.java @@ -577,7 +577,12 @@ public abstract class TWidget implements Comparable { width = resize.getWidth(); height = resize.getHeight(); if (layout != null) { - layout.onResize(resize); + if (this instanceof TWindow) { + layout.onResize(new TResizeEvent(TResizeEvent.Type.WIDGET, + width - 2, height - 2)); + } else { + layout.onResize(resize); + } } } else { // Let children see the screen resize @@ -2487,4 +2492,19 @@ public abstract class TWidget implements Comparable { gridRows); } + /** + * Convenience function to add a panel to this container/window. + * + * @param x column relative to parent + * @param y row relative to parent + * @param width width of text area + * @param height height of text area + * @return the new panel + */ + public final TPanel addPanel(final int x, final int y, final int width, + final int height) { + + return new TPanel(this, x, y, width, height); + } + }