git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix crash when closing terminal window
[nikiroo-utils.git]
/
src
/
jexer
/
TWidget.java
diff --git
a/src/jexer/TWidget.java
b/src/jexer/TWidget.java
index e94fed25077c68ca763b8dc90e76b98d36898469..012ed756c3a60adf4f40bf72e9c54954a3c28e98 100644
(file)
--- a/
src/jexer/TWidget.java
+++ b/
src/jexer/TWidget.java
@@
-36,6
+36,7
@@
import java.util.ArrayList;
import jexer.backend.Screen;
import jexer.bits.Cell;
import jexer.bits.CellAttributes;
import jexer.backend.Screen;
import jexer.bits.Cell;
import jexer.bits.CellAttributes;
+import jexer.bits.Clipboard;
import jexer.bits.ColorTheme;
import jexer.event.TCommandEvent;
import jexer.event.TInputEvent;
import jexer.bits.ColorTheme;
import jexer.event.TCommandEvent;
import jexer.event.TInputEvent;
@@
-598,9
+599,8
@@
public abstract class TWidget implements Comparable<TWidget> {
* @param command command event
*/
public void onCommand(final TCommandEvent command) {
* @param command command event
*/
public void onCommand(final TCommandEvent command) {
- // Default: do nothing, pass to children instead
- for (TWidget widget: children) {
- widget.onCommand(command);
+ if (activeChild != null) {
+ activeChild.onCommand(command);
}
}
}
}
@@
-1133,6
+1133,18
@@
public abstract class TWidget implements Comparable<TWidget> {
return null;
}
return null;
}
+ /**
+ * Get the Clipboard.
+ *
+ * @return the Clipboard, or null if not assigned
+ */
+ public Clipboard getClipboard() {
+ if (window != null) {
+ return window.getApplication().getClipboard();
+ }
+ return null;
+ }
+
/**
* Comparison operator. For various subclasses it sorts on:
* <ul>
/**
* Comparison operator. For various subclasses it sorts on:
* <ul>