branch : pmacs2
This commit is contained in:
moculus 2007-06-04 14:06:04 +00:00
parent bb2716a532
commit 66895d1aeb
1 changed files with 4 additions and 23 deletions

View File

@ -159,14 +159,13 @@ class Application:
buffers.append(buffer2.ConsoleBuffer()) buffers.append(buffer2.ConsoleBuffer())
self.bufferlist = bufferlist.BufferList(height, width) self.bufferlist = bufferlist.BufferList(height, width)
self.active_slot = 0 self.active_slot = 0
self.resize_slots() #self.resize_slots()
# build windows for our buffers # build windows for our buffers
for b in buffers: for b in buffers:
window2.Window(b, self, height, width, mode_name=init_mode) window2.Window(b, self, height, width, mode_name=init_mode)
self.bufferlist.add_buffer(b) self.bufferlist.add_buffer(b)
self.bufferlist.set_slot(0, buffers[0]) self.bufferlist.set_slot(0, buffers[0])
self.resize_windows()
# see if the user has requested that we go to a particular line # see if the user has requested that we go to a particular line
if jump_to_line: if jump_to_line:
@ -338,31 +337,13 @@ class Application:
def resize_event(self): def resize_event(self):
self.y, self.x = self.stdscr.getmaxyx() self.y, self.x = self.stdscr.getmaxyx()
self.resize_slots() self.resize_slots()
self.resize_windows()
def resize_slots(self): def resize_slots(self):
n = len(self.bufferlist.slots) n = len(self.bufferlist.slots)
assert n > 0
x = self.x - 1 x = self.x - 1
y_sum = self.y - 1 - n y_sum = self.y - 1 - n
y_pool = y_sum # XYZ this method seems broken
y_offset = 0 self.bufferlist.resize(x, y_sum)
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)
# hide the curses cursor # hide the curses cursor
def hide_cursor(self): def hide_cursor(self):