Update Tables_Demo. Found/fixed bug in XTables.

This commit is contained in:
Eratosthenes 2010-12-04 11:22:02 -05:00
parent 94bdc43deb
commit dd542db59d
2 changed files with 10 additions and 5 deletions

View File

@ -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)

View File

@ -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)