update_table_position will kill huds that are closed, timer will not be called when under unix, currently, as this function only works in windows.
checkPositions() accepts position 9 again.
This commit is contained in:
parent
65e43a34e6
commit
691608b6ca
|
@ -123,6 +123,15 @@ class Hud:
|
||||||
self.main_window.set_destroy_with_parent(True)
|
self.main_window.set_destroy_with_parent(True)
|
||||||
|
|
||||||
def update_table_position(self):
|
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()
|
(x, y) = self.main_window.parentgdkhandle.get_origin()
|
||||||
if self.table.x != x or self.table.y != y:
|
if self.table.x != x or self.table.y != y:
|
||||||
self.table.x = x
|
self.table.x = x
|
||||||
|
@ -134,7 +143,7 @@ class Hud:
|
||||||
(x, y) = loc[adj[i]]
|
(x, y) = loc[adj[i]]
|
||||||
if self.stat_windows.has_key(i):
|
if self.stat_windows.has_key(i):
|
||||||
self.stat_windows[i].relocate(x, y)
|
self.stat_windows[i].relocate(x, y)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def on_button_press(self, widget, event):
|
def on_button_press(self, widget, event):
|
||||||
|
@ -229,7 +238,7 @@ class Hud:
|
||||||
aux_params = config.get_aux_parameters(game_params['aux'])
|
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'])))
|
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):
|
def update(self, hand, config, stat_dict):
|
||||||
self.hand = hand # this is the last hand, so it is available later
|
self.hand = hand # this is the last hand, so it is available later
|
||||||
|
|
|
@ -90,7 +90,7 @@ def checkPositions(positions):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
### RHH modified to allow for "position 9" here (pos==9 is when you're a dead hand before the BB
|
### 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))
|
raise FpdbError("invalid position found in checkPositions. i: "+str(i)+" position: "+str(pos))
|
||||||
#end def fpdb_simple.checkPositions
|
#end def fpdb_simple.checkPositions
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user