diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 92f38bb7..1de69413 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -123,6 +123,15 @@ class Hud: self.main_window.set_destroy_with_parent(True) def update_table_position(self): +# self.main_window.parentgdkhandle = gtk.gdk.window_foreign_new(self.table.number) +# if self.main_window.parentgdkhandle == None: + if os.name == 'nt': + if not win32gui.IsWindow(self.table.number): + self.kill_hud() + return False + else: + return False # kill the timer under Unix, and ignore it until we have a way to check the validity of the window. + (x, y) = self.main_window.parentgdkhandle.get_origin() if self.table.x != x or self.table.y != y: self.table.x = x @@ -134,7 +143,7 @@ class Hud: (x, y) = loc[adj[i]] if self.stat_windows.has_key(i): self.stat_windows[i].relocate(x, y) - + return True def on_button_press(self, widget, event): @@ -229,7 +238,7 @@ class Hud: aux_params = config.get_aux_parameters(game_params['aux']) self.aux_windows.append(eval("%s.%s(gtk.Window(), self, config, 'fpdb')" % (aux_params['module'], aux_params['class']))) -# gobject.timeout_add(500, self.update_table_position) + gobject.timeout_add(500, self.update_table_position) def update(self, hand, config, stat_dict): self.hand = hand # this is the last hand, so it is available later diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index 7c9bbe21..6e70b699 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -90,7 +90,7 @@ def checkPositions(positions): pass ### RHH modified to allow for "position 9" here (pos==9 is when you're a dead hand before the BB - if (pos!="B" and pos!="S" and pos!=0 and pos!=1 and pos!=2 and pos!=3 and pos!=4 and pos!=5 and pos!=6 and pos!=7 and pos!=9): + if (pos!="B" and pos!="S" and pos!=0 and pos!=1 and pos!=2 and pos!=3 and pos!=4 and pos!=5 and pos!=6 and pos!=7 and pos != 8 and pos!=9): raise FpdbError("invalid position found in checkPositions. i: "+str(i)+" position: "+str(pos)) #end def fpdb_simple.checkPositions