+ if (root == null) {
+ assert (getDesktop().getActiveChild() == null);
+ createRootTerminal();
+ return true;
+ }
+ TWidget active = getDesktop().getActiveChild();
+ TSplitPane split = active.splitHorizontal(false,
+ new TTerminalWidget(active, active.getX(),
+ active.getY(), active.getWidth(), active.getHeight(),
+ new TAction() {
+ public void DO() {
+ if (source.getParent() instanceof TSplitPane) {
+ ((TSplitPane) source.getParent()).removeSplit(source, true);
+ } else if (source == root) {
+ assert (root != null);
+ root.remove();
+ root = null;
+ }
+ }
+ }));
+ if (active == root) {
+ root = split;
+ }
+ System.err.println("\nAfter horizontal split:");
+ System.err.println(getDesktop().toPrettyString());