X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTWidget.java;h=84277a8c2acc8dba6d46ff018ddbfbdc232404ce;hb=cc99cba8bdfb594d4606949f1763898a420e7f34;hp=25e43f71f7e651d503709214cd68d656467c0d8f;hpb=128e5be1ffb65d047d8461ea1cfb65c22686ec91;p=fanfix.git diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index 25e43f7..84277a8 100644 --- a/src/jexer/TWidget.java +++ b/src/jexer/TWidget.java @@ -1097,4 +1097,40 @@ public abstract class TWidget implements Comparable { updateAction); } + /** + * Convenience function to add a scrollable text box to this + * container/window. + * + * @param text text on the screen + * @param x column relative to parent + * @param y row relative to parent + * @param width width of text area + * @param height height of text area + * @param colorKey ColorTheme key color to use for foreground text + * @return the new text box + */ + public TText addText(final String text, final int x, + final int y, final int width, final int height, final String colorKey) { + + return new TText(this, text, x, y, width, height, colorKey); + } + + /** + * Convenience function to add a scrollable text box to this + * container/window. + * + * @param text text on the screen + * @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 text box + */ + public TText addText(final String text, final int x, final int y, + final int width, final int height) { + + return new TText(this, text, x, y, width, height, "ttext"); + } + + }