Fri, 02 Dec 2011 20:41:36 +0100
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