empathy r803 - trunk/python



Author: xclaesse
Date: Sun Mar 16 13:55:34 2008
New Revision: 803
URL: http://svn.gnome.org/viewvc/empathy?rev=803&view=rev

Log:
Add python example


Added:
   trunk/python/example.py

Added: trunk/python/example.py
==============================================================================
--- (empty file)
+++ trunk/python/example.py	Sun Mar 16 13:55:34 2008
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+
+import gtk
+import empathy
+import empathygtk
+
+class HelloWorld:
+
+    def destroy(self, widget, data=None):
+        print "destroy signal occurred"
+        gtk.main_quit()
+
+    def __init__(self):
+        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
+        self.window.connect("destroy", self.destroy)
+
+        manager = empathy.ContactManager()
+        store = empathygtk.ContactListStore(manager)
+        view = empathygtk.ContactListView(store, 0)
+
+        self.window.add (view)
+        view.show()
+        self.window.show()
+
+    def main(self):
+        gtk.main()
+
+if __name__ == "__main__":
+    hello = HelloWorld()
+    hello.main()
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]