diff --git a/pyfpdb/Tables_Demo.py b/pyfpdb/Tables_Demo.py index f00c201e..86e5f1f3 100644 --- a/pyfpdb/Tables_Demo.py +++ b/pyfpdb/Tables_Demo.py @@ -30,6 +30,7 @@ import sys import os # pyGTK modules +import pygtk import gtk import gobject @@ -60,7 +61,7 @@ if __name__=="__main__": self.main_window.set_title(_("Fake HUD Main Window")) self.main_window.move(table.x + dx, table.y + dy) self.main_window.show_all() - table.topify(self) + table.topify(self.main_window) # These are the currently defined signals. Do this in the HUD. self.main_window.connect("client_moved", self.client_moved) @@ -103,7 +104,7 @@ if __name__=="__main__": table_kwargs = dict(table_name = table_name) table = Tables.Table(config, "Full Tilt Poker", **table_kwargs) - table.gdk_handle = gtk.gdk.window_foreign_new(table.number) + table.gdkhandle = gtk.gdk.window_foreign_new(table.number) print table fake = fake_hud(table) diff --git a/pyfpdb/XTables.py b/pyfpdb/XTables.py index b082b8b2..4a5af947 100644 --- a/pyfpdb/XTables.py +++ b/pyfpdb/XTables.py @@ -98,7 +98,11 @@ class Table(Table_Window): except AttributeError: return None + def topify(self, window): +# The idea here is to call set_transient_for on the HUD window, with the table window +# as the argument. This should keep the HUD window on top of the table window, as if +# the hud window was a dialog belonging to the table. - def topify(self, hud): - hud.main_window.gdkhandle = gtk.gdk.window_foreign_new(hud.main_window.window.xid) - hud.main_window.gdkhandle.set_transient_for(self.gdk_handle) +# This is the gdkhandle for the HUD window + gdkwindow = gtk.gdk.window_foreign_new(window.window.xid) + gdkwindow.set_transient_for(self.gdkhandle) \ No newline at end of file