Make windows more nearly happy - adapt change from Eric.

This commit is contained in:
Eratosthenes 2010-12-11 10:42:04 -05:00
parent aeaf64e469
commit 669fb58471
3 changed files with 8 additions and 2 deletions

1
pyfpdb/HUD_main.pyw Executable file → Normal file
View File

@ -343,6 +343,7 @@ def idle_create(hud_main, new_hand_id, table, temp_key, max, poker_game, type, s
gtk.gdk.threads_enter()
try:
if table.gdkhandle is not None: # on windows this should already be set
table.gdkhandle = gtk.gdk.window_foreign_new(table.number)
newlabel = gtk.Label("%s - %s" % (table.site, temp_key))
hud_main.vb.add(newlabel)

View File

@ -117,6 +117,7 @@ class Table_Window(object):
self.config = config
self.site = site
self.hud = None # fill in later
self.gdkhandle = None
if tournament is not None and table_number is not None:
self.tournament = int(tournament)
self.table = int(table_number)
@ -136,7 +137,6 @@ class Table_Window(object):
self.search_string = getTableTitleRe(self.config, self.site, self.type, **table_kwargs)
self.find_table_parameters()
# self.gdkhandle = gtk.gdk.window_foreign_new(self.number)
geo = self.get_geometry()
if geo is None: return None
self.width = geo['width']

View File

@ -76,6 +76,11 @@ class Table(Table_Window):
self.title = titles[hwnd]
self.hud = None
self.number = hwnd
if self.gdkhandle is not None:
try: # Windows likes this here - Linux doesn't
self.gdkhandle = gtk.gdk.window_foreign_new(self.number)
except AttributeError:
pass
def get_geometry(self):
try: