From 66895d1aebd2a5279a523a8125ee4779ef065be2 Mon Sep 17 00:00:00 2001 From: moculus Date: Mon, 4 Jun 2007 14:06:04 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- application.py | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/application.py b/application.py index 1ade56d..10bc8bf 100755 --- a/application.py +++ b/application.py @@ -159,14 +159,13 @@ class Application: buffers.append(buffer2.ConsoleBuffer()) self.bufferlist = bufferlist.BufferList(height, width) self.active_slot = 0 - self.resize_slots() + #self.resize_slots() # build windows for our buffers for b in buffers: window2.Window(b, self, height, width, mode_name=init_mode) self.bufferlist.add_buffer(b) self.bufferlist.set_slot(0, buffers[0]) - self.resize_windows() # see if the user has requested that we go to a particular line if jump_to_line: @@ -338,31 +337,13 @@ class Application: def resize_event(self): self.y, self.x = self.stdscr.getmaxyx() self.resize_slots() - self.resize_windows() def resize_slots(self): n = len(self.bufferlist.slots) + assert n > 0 x = self.x - 1 y_sum = self.y - 1 - n - y_pool = y_sum - y_offset = 0 - for i in range(0, n - 1): - slot = self.bufferlist.slots[i] - y = y_sum / n - slot.resize(y, x, y_offset) - y_pool -= y - y_offset += y + 1 - slot = self.bufferlist.slots[n-1].resize(y_pool, x, y_offset) - def resize_windows(self): - #for slot in - pass -# for b in self.bufferlist.buffers: -# keys = b.windows.keys() -# for w in b.windows: -# try: -# (height, width) = self.get_window_height_width(name) -# b.windows[name].set_size(width, height) -# except: -# b.windows.remove(w) + # XYZ this method seems broken + self.bufferlist.resize(x, y_sum) # hide the curses cursor def hide_cursor(self):