added slotUI path

Fri, 02 Dec 2011 20:41:36 +0100

author
Malte Bayer <mbayer@neo-soft.org>
date
Fri, 02 Dec 2011 20:41:36 +0100
changeset 23
6edcf4666e3b
parent 22
9af54a45ae42
child 24
84f6f0592555

added slotUI path

slotUI/README file | annotate | diff | comparison | revisions
slotUI/SlotUi.py file | annotate | diff | comparison | revisions
slotUI/freeslot.py file | annotate | diff | comparison | revisions
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/slotUI/README	Fri Dec 02 20:41:36 2011 +0100
@@ -0,0 +1,3 @@
+At the moment just for testing stuff & rudimentary protocol definition
+
++ GTK GUI testing
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/slotUI/SlotUi.py	Fri Dec 02 20:41:36 2011 +0100
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+
+import pygtk
+pygtk.require('2.0')
+import gtk
+
+class SlotUi:
+    """
+    Graphical User Interface
+    using GTK
+    """
+    def delete_event(self, widget, event, data=None):
+        if widget == self.window:
+            self.destroy(widget, data)
+        #return true to stop window destruction
+        return False
+
+    def destroy(self, widget, data=None):
+        gtk.main_quit()
+
+    def __init__(self):
+        # create main window
+        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
+        self.window.connect("delete_event", self.delete_event)
+        self.button = gtk.Button("Hello World")
+        self.button.connect("clicked", self.hello, None)
+        
+        self.window.add(self.button)
+        self.button.show()
+        self.window.show()
+
+    def hello(self, widget, param1):
+        print widget
+        print "hello"
+
+    def main(self):
+        gtk.main()
+
+if __name__ == "__main__":
+    app = SlotUi()
+    app.main()
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/slotUI/freeslot.py	Fri Dec 02 20:41:36 2011 +0100
@@ -0,0 +1,5 @@
+"""
+FreeSlot project
+Blackbox communication library
+"""
+

mercurial