X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=cfa81f4bab05f6508cdbefe7acb53ed096a1df1e;hb=a0d734e68fc28e441d74075e4d8d0166bbcde180;hp=b7c5f8ef51e5c63f30605d840d8dab0967f1b86b;hpb=b2d49e0f15810a35a206e88c9bad11b053ed65fc;p=nikiroo-utils.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index b7c5f8e..cfa81f4 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -1941,10 +1941,16 @@ public class TApplication implements Runnable { continue; } for (int x = w.getX(); x < w.getX() + w.getWidth(); x++) { + if (x < 0) { + continue; + } if (x >= width) { continue; } for (int y = w.getY(); y < w.getY() + w.getHeight(); y++) { + if (y < 0) { + continue; + } if (y >= height) { continue; } @@ -2830,6 +2836,22 @@ public class TApplication implements Runnable { return openTerminal(x, y, TWindow.RESIZABLE, commandLine); } + /** + * Convenience function to open a terminal window and execute a custom + * command line inside it. + * + * @param x column relative to parent + * @param y row relative to parent + * @param flags mask of CENTERED, MODAL, or RESIZABLE + * @param command the command line to execute + * @return the terminal new window + */ + public final TTerminalWindow openTerminal(final int x, final int y, + final int flags, final String [] command) { + + return new TTerminalWindow(this, x, y, flags, command); + } + /** * Convenience function to open a terminal window and execute a custom * command line inside it. @@ -2843,7 +2865,7 @@ public class TApplication implements Runnable { public final TTerminalWindow openTerminal(final int x, final int y, final int flags, final String commandLine) { - return new TTerminalWindow(this, x, y, flags, commandLine); + return new TTerminalWindow(this, x, y, flags, commandLine.split("\\s")); } /**