summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-05-02 03:01:13 +0200
committermathieui <mathieui@mathieui.net>2014-05-02 03:01:13 +0200
commitd1e33e1863193516a46b96fc9831a3ed03570f7b (patch)
treee5c23f12b97a40c3e78ed671f3b93137ce3ad2a1 /src
parentb080c53ac428d3814a6b1e7eadf63b305818f051 (diff)
downloadpoezio-d1e33e1863193516a46b96fc9831a3ed03570f7b.tar.gz
poezio-d1e33e1863193516a46b96fc9831a3ed03570f7b.tar.bz2
poezio-d1e33e1863193516a46b96fc9831a3ed03570f7b.tar.xz
poezio-d1e33e1863193516a46b96fc9831a3ed03570f7b.zip
Make the FormWin handle resize properly
(also, wrap one forgotten call to curses funcs)
Diffstat (limited to 'src')
-rw-r--r--src/tabs/data_forms.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tabs/data_forms.py b/src/tabs/data_forms.py
index 5f44a8f6..d5d4318a 100644
--- a/src/tabs/data_forms.py
+++ b/src/tabs/data_forms.py
@@ -66,9 +66,11 @@ class DataFormsTab(Tab):
def resize(self):
self.need_resize = False
self.topic_win.resize(1, self.width, 0, 0)
- self.form_win.resize(self.height-3 - Tab.tab_win_height(), self.width, 1, 0)
- self.help_win.resize(1, self.width, self.height-1, 0)
- self.help_win_dyn.resize(1, self.width, self.height-2 - Tab.tab_win_height(), 0)
+ self.form_win.resize(self.height - 3 - Tab.tab_win_height(),
+ self.width, 1, 0)
+ self.help_win.resize(1, self.width, self.height - 1, 0)
+ self.help_win_dyn.resize(1, self.width,
+ self.height - 2 - Tab.tab_win_height(), 0)
self.lines = []
def refresh(self):
@@ -412,7 +414,8 @@ class FormWin(object):
}
def __init__(self, form, height, width, y, x):
self._form = form
- self._win = windows.Win._tab_win.derwin(height, width, y, x)
+ with g_lock:
+ self._win = windows.Win._tab_win.derwin(height, width, y, x)
self.scroll_pos = 0
self.current_input = 0
self.inputs = [] # dict list
@@ -435,6 +438,8 @@ class FormWin(object):
def resize(self, height, width, y, x):
self.height = height
self.width = width
+ with g_lock:
+ self._win = windows.Win._tab_win.derwin(height, width, y, x)
# Adjust the scroll position, if resizing made the window too small
# for the cursor to be visible
while self.current_input - self.scroll_pos > self.height-1: