git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#51 wip
[fanfix.git]
/
examples
/
JexerTilingWindowManager2.java
diff --git
a/examples/JexerTilingWindowManager2.java
b/examples/JexerTilingWindowManager2.java
index cb7f0d0263659a4be295d7c0397f3836ce0d3098..accbf739317bf0212c1c7aa07c6fb2e934b84b11 100644
(file)
--- a/
examples/JexerTilingWindowManager2.java
+++ b/
examples/JexerTilingWindowManager2.java
@@
-88,12
+88,13
@@
public class JexerTilingWindowManager2 extends TApplication {
protected boolean onMenu(TMenuEvent event) {
if (event.getId() == MENU_SPLIT_VERTICAL) {
if (root == null) {
protected boolean onMenu(TMenuEvent event) {
if (event.getId() == MENU_SPLIT_VERTICAL) {
if (root == null) {
+ assert (getDesktop().getActiveChild() == null);
createRootTerminal();
return true;
}
createRootTerminal();
return true;
}
- TWidget active =
root
.getActiveChild();
+ TWidget active =
getDesktop()
.getActiveChild();
TSplitPane split = active.splitVertical(false,
TSplitPane split = active.splitVertical(false,
- new TTerminalWidget(
getDesktop()
, active.getX(),
+ new TTerminalWidget(
active
, active.getX(),
active.getY(), active.getWidth(), active.getHeight(),
new TAction() {
public void DO() {
active.getY(), active.getWidth(), active.getHeight(),
new TAction() {
public void DO() {
@@
-106,20
+107,22
@@
public class JexerTilingWindowManager2 extends TApplication {
}
}
}));
}
}
}));
-
if (active == root) {
root = split;
}
if (active == root) {
root = split;
}
+ System.err.println("\nAfter vertical split:");
+ System.err.println(getDesktop().toPrettyString());
return true;
}
if (event.getId() == MENU_SPLIT_HORIZONTAL) {
if (root == null) {
return true;
}
if (event.getId() == MENU_SPLIT_HORIZONTAL) {
if (root == null) {
+ assert (getDesktop().getActiveChild() == null);
createRootTerminal();
return true;
}
createRootTerminal();
return true;
}
- TWidget active =
root
.getActiveChild();
+ TWidget active =
getDesktop()
.getActiveChild();
TSplitPane split = active.splitHorizontal(false,
TSplitPane split = active.splitHorizontal(false,
- new TTerminalWidget(
getDesktop()
, active.getX(),
+ new TTerminalWidget(
active
, active.getX(),
active.getY(), active.getWidth(), active.getHeight(),
new TAction() {
public void DO() {
active.getY(), active.getWidth(), active.getHeight(),
new TAction() {
public void DO() {
@@
-132,6
+135,11
@@
public class JexerTilingWindowManager2 extends TApplication {
}
}
}));
}
}
}));
+ if (active == root) {
+ root = split;
+ }
+ System.err.println("\nAfter horizontal split:");
+ System.err.println(getDesktop().toPrettyString());
return true;
}
return true;
}