diff --git a/pyfpdb/HUD_main.pyw b/pyfpdb/HUD_main.pyw old mode 100755 new mode 100644 index 8de098b6..cd29f4ae --- a/pyfpdb/HUD_main.pyw +++ b/pyfpdb/HUD_main.pyw @@ -130,7 +130,7 @@ class HUD_main(object): else: self.main_window.set_icon_stock(gtk.STOCK_HOME) self.main_window.show_all() -# gobject.timeout_add(100, self.check_tables) + gobject.timeout_add(100, self.check_tables) except: log.error("*** Exception in HUD_main.init() *** ") @@ -138,15 +138,12 @@ class HUD_main(object): log.error(e) def client_moved(self, widget, hud): - print "hud_main: client moved" - print hud, hud.table.name, "moved", hud.table.x, hud.table.y + hud.up_update_table_position() def client_resized(self, widget, hud): - print _("hud_main: Client resized") - print hud, hud.table.name, hud.table.x, hud.table.y + pass def client_destroyed(self, widget, hud): # call back for terminating the main eventloop - print _("hud_main: Client destroyed") self.kill_hud(None, hud.table.name) def game_changed(self, widget, hud): diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 7bec888c..ac22d893 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -495,6 +495,22 @@ class Hud: return True + def up_update_table_position(self): +# callback for table moved + +# move the stat windows + adj = self.adj_seats(self.hand, self.config) + loc = self.config.get_locations(self.table.site, self.max) + for i, w in enumerate(self.stat_windows.itervalues()): + (x, y) = loc[adj[i+1]] + w.relocate(x, y) +# move the main window + self.main_window.move(self.table.x + self.site_params['xshift'], self.table.y + self.site_params['yshift']) +# and move any auxs + for aux in self.aux_windows: + aux.update_card_positions() + return True + def on_button_press(self, widget, event): if event.button == 1: # if primary button, start movement self.main_window.begin_move_drag(event.button, int(event.x_root), int(event.y_root), event.time) diff --git a/pyfpdb/TableWindow.py b/pyfpdb/TableWindow.py index ec694c73..d780bdbc 100644 --- a/pyfpdb/TableWindow.py +++ b/pyfpdb/TableWindow.py @@ -245,7 +245,7 @@ class Table_Window(object): return "client_destroyed" if self.x != new_geo['x'] or self.y != new_geo['y']: # window moved - print self.x, self.y, new_geo['x'], new_geo['y'] +# print self.x, self.y, new_geo['x'], new_geo['y'] self.x = new_geo['x'] self.y = new_geo['y'] return "client_moved"