Q&D change for old Hud code to remove the loop from one topify_window(), as we found out how to get it when working on the new Hud stuff

This commit is contained in:
eblade 2009-06-10 14:11:20 -04:00
parent eb37de3594
commit c63e0ab461

View File

@ -339,30 +339,30 @@ class Hud:
Stats.do_tip(window.e_box[r][c], tip) Stats.do_tip(window.e_box[r][c], tip)
def topify_window(self, window): def topify_window(self, window):
"""Set the specified gtk window to stayontop in MS Windows.""" # """Set the specified gtk window to stayontop in MS Windows."""
#
def windowEnumerationHandler(hwnd, resultList): # def windowEnumerationHandler(hwnd, resultList):
'''Callback for win32gui.EnumWindows() to generate list of window handles.''' # '''Callback for win32gui.EnumWindows() to generate list of window handles.'''
resultList.append((hwnd, win32gui.GetWindowText(hwnd))) # resultList.append((hwnd, win32gui.GetWindowText(hwnd)))
# unique_name = 'unique name for finding this window'
unique_name = 'unique name for finding this window' # real_name = window.get_title()
real_name = window.get_title() # window.set_title(unique_name)
window.set_title(unique_name) # tl_windows = []
tl_windows = [] # win32gui.EnumWindows(windowEnumerationHandler, tl_windows)
win32gui.EnumWindows(windowEnumerationHandler, tl_windows) #
# for w in tl_windows:
for w in tl_windows: # if w[1] == unique_name:
if w[1] == unique_name:
self.main_window.parentgdkhandle = gtk.gdk.window_foreign_new(long(self.table.number)) self.main_window.parentgdkhandle = gtk.gdk.window_foreign_new(long(self.table.number))
self.main_window.gdkhandle = gtk.gdk.window_foreign_new(w[0]) # self.main_window.gdkhandle = gtk.gdk.window_foreign_new(w[0])
self.main_window.gdkhandle = self.main_window.window
self.main_window.gdkhandle.set_transient_for(self.main_window.parentgdkhandle) self.main_window.gdkhandle.set_transient_for(self.main_window.parentgdkhandle)
style = win32gui.GetWindowLong(self.table.number, win32con.GWL_EXSTYLE) style = win32gui.GetWindowLong(self.table.number, win32con.GWL_EXSTYLE)
style |= win32con.WS_CLIPCHILDREN style |= win32con.WS_CLIPCHILDREN
win32gui.SetWindowLong(self.table.number, win32con.GWL_EXSTYLE, style) win32gui.SetWindowLong(self.table.number, win32con.GWL_EXSTYLE, style)
break # break
window.set_title(real_name) # window.set_title(real_name)
class Stat_Window: class Stat_Window: