added parent-window to minibuffer

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2009-07-12 14:55:01 -04:00
parent d4ebbaf5c9
commit 3512296eb8
2 changed files with 5 additions and 2 deletions

View File

@ -405,10 +405,12 @@ class Application(object):
return self.mini_buffer is not None return self.mini_buffer is not None
def open_mini_buffer(self, prompt, cb, method=None, tabber=None, def open_mini_buffer(self, prompt, cb, method=None, tabber=None,
modename=None, startvalue=None, queue='default'): modename=None, startvalue=None, queue='default'):
parentw = self.bufferlist.slots[self.active_slot].window
if self.mini_buffer_is_open(): if self.mini_buffer_is_open():
self.close_mini_buffer() self.close_mini_buffer()
self.mini_prompt = prompt self.mini_prompt = prompt
self.mini_buffer = MiniBuffer(cb, self, method, tabber, modename, queue) self.mini_buffer = MiniBuffer(cb, self, method, tabber, modename, queue,
parentw)
try: try:
w = self.x - 1 - len(self.mini_prompt) - 1 w = self.x - 1 - len(self.mini_prompt) - 1
window.Window(self.mini_buffer, self, height=1, width=w) window.Window(self.mini_buffer, self, height=1, width=w)

View File

@ -14,7 +14,7 @@ class MiniBuffer(buffer.Buffer):
return mini return mini
# the callback function should take one argument (window) # the callback function should take one argument (window)
def __init__(self, func, app, method=None, tabber=None, modename=None, def __init__(self, func, app, method=None, tabber=None, modename=None,
queue=None): queue=None, parentw=None):
buffer.Buffer.__init__(self) buffer.Buffer.__init__(self)
self.app = app self.app = app
self.callback = func self.callback = func
@ -22,6 +22,7 @@ class MiniBuffer(buffer.Buffer):
self.tabber = tabber self.tabber = tabber
self.modename = modename self.modename = modename
self.queue = queue self.queue = queue
self.parentw = parentw
def name(self): def name(self):
return "*Minibuffer*" return "*Minibuffer*"