From 669fb58471d3678b40b4c5e7dc463fb3a8a8d3d4 Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Sat, 11 Dec 2010 10:42:04 -0500 Subject: [PATCH] Make windows more nearly happy - adapt change from Eric. --- pyfpdb/HUD_main.pyw | 3 ++- pyfpdb/TableWindow.py | 2 +- pyfpdb/WinTables.py | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) mode change 100755 => 100644 pyfpdb/HUD_main.pyw diff --git a/pyfpdb/HUD_main.pyw b/pyfpdb/HUD_main.pyw old mode 100755 new mode 100644 index 55fa7d93..34b701c9 --- a/pyfpdb/HUD_main.pyw +++ b/pyfpdb/HUD_main.pyw @@ -343,7 +343,8 @@ def idle_create(hud_main, new_hand_id, table, temp_key, max, poker_game, type, s gtk.gdk.threads_enter() try: - table.gdkhandle = gtk.gdk.window_foreign_new(table.number) + 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) newlabel.show() diff --git a/pyfpdb/TableWindow.py b/pyfpdb/TableWindow.py index 2f13634f..05c6ce4e 100644 --- a/pyfpdb/TableWindow.py +++ b/pyfpdb/TableWindow.py @@ -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'] diff --git a/pyfpdb/WinTables.py b/pyfpdb/WinTables.py index b7114ae3..599e51c6 100644 --- a/pyfpdb/WinTables.py +++ b/pyfpdb/WinTables.py @@ -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: