From 3512296eb8763ec4e151e64e1cb8a90c48021cfe Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Sun, 12 Jul 2009 14:55:01 -0400 Subject: [PATCH] added parent-window to minibuffer --HG-- branch : pmacs2 --- application.py | 4 +++- minibuffer.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application.py b/application.py index d1b5cb1..4f81c56 100755 --- a/application.py +++ b/application.py @@ -405,10 +405,12 @@ class Application(object): return self.mini_buffer is not None def open_mini_buffer(self, prompt, cb, method=None, tabber=None, modename=None, startvalue=None, queue='default'): + parentw = self.bufferlist.slots[self.active_slot].window if self.mini_buffer_is_open(): self.close_mini_buffer() 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: w = self.x - 1 - len(self.mini_prompt) - 1 window.Window(self.mini_buffer, self, height=1, width=w) diff --git a/minibuffer.py b/minibuffer.py index ebee996..da73812 100644 --- a/minibuffer.py +++ b/minibuffer.py @@ -14,7 +14,7 @@ class MiniBuffer(buffer.Buffer): return mini # the callback function should take one argument (window) def __init__(self, func, app, method=None, tabber=None, modename=None, - queue=None): + queue=None, parentw=None): buffer.Buffer.__init__(self) self.app = app self.callback = func @@ -22,6 +22,7 @@ class MiniBuffer(buffer.Buffer): self.tabber = tabber self.modename = modename self.queue = queue + self.parentw = parentw def name(self): return "*Minibuffer*"