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):