From d81a701ec27328bd414901938be18aa0e0c05a42 Mon Sep 17 00:00:00 2001 From: eblade Date: Thu, 5 Mar 2009 21:27:12 -0500 Subject: [PATCH] fix kill hud not killing popups, fix some popup bugs --- pyfpdb/Hud.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 05696a9d..598a6939 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -190,8 +190,7 @@ class Hud: # kill all stat_windows, popups and aux_windows in this HUD # heap dead, burnt bodies, blood 'n guts, veins between my teeth for s in self.stat_windows.itervalues(): - for p in s.popups: - s.kill_popup(p) + s.kill_popups() s.window.destroy() self.stat_windows = {} # also kill any aux windows @@ -369,6 +368,11 @@ class Stat_Window: def kill_popup(self, popup): popup.window.destroy() self.popups.remove(popup) + + def kill_popups(self): + for x in self.popups: + self.popups[x].window.destroy() + self.popups = { } def relocate(self, x, y): self.x = x + self.table.x @@ -557,8 +561,11 @@ class Popup_window: for w in tl_windows: if w[1] == unique_name: - win32gui.SetWindowPos(w[0], win32con.HWND_TOPMOST, 0, 0, 0, 0, win32con.SWP_NOMOVE|win32con.SWP_NOSIZE) - + window.set_transient_for(self.parent.main_window) + style = win32gui.GetWindowLong(self.table.number, win32con.GWL_EXSTYLE) + style |= win32con.WS_CLIPCHILDREN + win32gui.SetWindowLong(self.table.number, win32con.GWL_EXSTYLE, style) + window.set_title(real_name) if __name__== "__main__":