Should now run on windows--but not work correctly.

This commit is contained in:
Ray 2009-06-09 16:38:26 -04:00
parent dd80468f5f
commit eea4656f47

View File

@ -72,7 +72,8 @@ class Table(Table_Window):
self.title = titles[hwnd] self.title = titles[hwnd]
self.site = "" self.site = ""
self.hud = None self.hud = None
self.number = gtk.gdk.window_foreign_new(long(self.window)) self.number = hwnd
self.gdkhandle = gtk.gdk.window_foreign_new(long(self.window))
def get_geometry(self): def get_geometry(self):
@ -112,10 +113,7 @@ class Table(Table_Window):
win32api.CloseHandle(hToken) win32api.CloseHandle(hToken)
return exename return exename
def win_enum_handler(hwnd, titles): def topify(self, hud):
titles[hwnd] = win32gui.GetWindowText(hwnd)
def topify_window(hud, 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):
@ -123,21 +121,23 @@ def topify_window(hud, window):
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 = hud.main_window.get_title()
window.set_title(unique_name) hud.main_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:
hud.main_window.parentgdkhandle = gtk.gdk.window_foreign_new(long(hud.table.number))
hud.main_window.gdkhandle = gtk.gdk.window_foreign_new(w[0]) hud.main_window.gdkhandle = gtk.gdk.window_foreign_new(w[0])
hud.main_window.gdkhandle.set_transient_for(hud.main_window.parentgdkhandle) hud.main_window.gdkhandle.set_transient_for(self.gdkhandle)
#
style = win32gui.GetWindowLong(self.table.number, win32con.GWL_EXSTYLE) # style = win32gui.GetWindowLong(self.number, win32con.GWL_EXSTYLE)
style |= win32con.WS_CLIPCHILDREN # style |= win32con.WS_CLIPCHILDREN
win32gui.SetWindowLong(hud.table.number, win32con.GWL_EXSTYLE, style) # win32gui.SetWindowLong(self.number, win32con.GWL_EXSTYLE, style)
break break
window.set_title(real_name) hud.main_window.set_title(real_name)
def win_enum_handler(hwnd, titles):
titles[hwnd] = win32gui.GetWindowText(hwnd)