summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/windows.py b/src/windows.py
index a949ca99..e6ca9800 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -734,6 +734,13 @@ class Input(Win):
self.on_input = None # callback called on any key pressed
self.color = None # use this color on addstr
+ def on_delete(self):
+ """
+ Remove all references kept to a tab, so that the tab
+ can be garbage collected
+ """
+ del self.key_func
+
def set_color(self, color):
self.color = color
self.rewrite_text()
@@ -1171,6 +1178,22 @@ class CommandInput(Input):
self.addstr(0, cursor_pos, '') # WTF, this works but .move() doesn't…
self._refresh()
+ def on_delete(self):
+ """
+ SERIOUSLY BIG WTF.
+
+ I can do
+ self.key_func.clear()
+
+ but not
+ del self.key_func
+ because that would raise an AttributeError exception. WTF.
+ """
+ self.on_abort = None
+ self.on_success = None
+ self.on_input = None
+ self.key_func.clear()
+
class VerticalSeparator(Win):
"""
Just a one-column window, with just a line in it, that is