X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTWidget.java;h=633b149575f24c74728ba740cb30fe7362e3e7fd;hb=9577a9d02a8b04eaf70c26fa33ec721f6e46e9fb;hp=9e02613735d210d2d95e00641c766b024c61ad4f;hpb=be528f1aa647a2b7afd8b401e67480586e3b63a6;p=fanfix.git diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index 9e02613..633b149 100644 --- a/src/jexer/TWidget.java +++ b/src/jexer/TWidget.java @@ -2334,6 +2334,31 @@ public abstract class TWidget implements Comparable { moveAction); } + /** + * Convenience function to add a list to this container/window. + * + * @param strings list of strings to show. This is allowed to be null + * and set later with setList() or by subclasses. + * @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 enterAction action to perform when an item is selected + * @param moveAction action to perform when the user navigates to a new + * item with arrow/page keys + * @param singleClickAction action to perform when the user clicks on an + * item + */ + public TList addList(final List strings, final int x, + final int y, final int width, final int height, + final TAction enterAction, final TAction moveAction, + final TAction singleClickAction) { + + return new TList(this, strings, x, y, width, height, enterAction, + moveAction, singleClickAction); + } + + /** * Convenience function to add an image to this container/window. *