summaryrefslogtreecommitdiff
path: root/docs/examples/pygtk_chat_client/ChatWindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/pygtk_chat_client/ChatWindow.py')
-rw-r--r--docs/examples/pygtk_chat_client/ChatWindow.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/examples/pygtk_chat_client/ChatWindow.py b/docs/examples/pygtk_chat_client/ChatWindow.py
new file mode 100644
index 0000000..51c8dff
--- /dev/null
+++ b/docs/examples/pygtk_chat_client/ChatWindow.py
@@ -0,0 +1,28 @@
+import gtk
+import gobject
+
+class ChatWindow(gtk.Window):
+ def __init__(self, channel):
+ super(ChatWindow, self).__init__()
+
+ self.sm = channel.sm
+ self.channel = channel
+
+ self.set_default_size(300, 300)
+ self.set_title('Chat with %s' % channel.target_id)
+
+ vbox = gtk.VBox()
+ self.add(vbox)
+
+ sw = gtk.ScrolledWindow()
+ vbox.pack_start (sw)
+
+ self.buffer = gtk.TextBuffer()
+ tv = gtk.TextView(self.buffer)
+ sw.add(tv)
+
+ vbox.show_all()
+
+ self.connect('destroy', lambda s: s.channel.close())
+
+gobject.type_register(ChatWindow)