From 7c0d2eb6c664cfd8122b975e58438cfd158ee398 Mon Sep 17 00:00:00 2001 From: eblade Date: Wed, 25 Mar 2009 19:33:01 -0400 Subject: [PATCH] weird, fix bug in window tracking --- pyfpdb/Hud.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 3fa677b6..0ecc0332 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -174,10 +174,10 @@ class Hud: self.main_window.move(x, y) adj = self.adj_seats(self.hand, self.config) loc = self.config.get_locations(self.table.site, self.max) + # TODO: is stat_windows getting converted somewhere from a list to a dict, for no good reason? for i, w in enumerate(self.stat_windows): - if not type(w) == int: # how do we get pure ints in this list?? - (x, y) = loc[adj[i]] - w.relocate(x, y) + (x, y) = loc[adj[i]] + self.stat_windows[w].relocate(x, y) return True @@ -415,8 +415,9 @@ class Stat_Window: self.window.set_transient_for(parent.main_window) self.window.set_focus_on_map(False) - self.grid = gtk.Table(rows = game.rows, columns = game.cols, homogeneous = False) - self.window.add(self.grid) + grid = gtk.Table(rows = game.rows, columns = game.cols, homogeneous = False) + self.grid = grid + self.window.add(grid) self.window.modify_bg(gtk.STATE_NORMAL, parent.backgroundcolor) self.e_box = [] @@ -440,10 +441,10 @@ class Stat_Window: Stats.do_tip(e_box[r][c], 'stuff') if usegtkframes: - self.grid.attach(self.frame[r][c], c, c+1, r, r+1, xpadding = 0, ypadding = 0) + grid.attach(self.frame[r][c], c, c+1, r, r+1, xpadding = 0, ypadding = 0) self.frame[r][c].add(e_box[r][c]) else: - self.grid.attach(e_box[r][c], c, c+1, r, r+1, xpadding = 0, ypadding = 0) + grid.attach(e_box[r][c], c, c+1, r, r+1, xpadding = 0, ypadding = 0) label[r].append( gtk.Label('xxx') ) if usegtkframes: