From: Bernard Blackham Date: Sun, 27 Jun 2004 19:35:27 +0000 (+0000) Subject: Groovy colours :) X-Git-Tag: IMPORT-FROM-UCCCVS~124 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=b6e0c70892ec3125bed5c07f10c08e76ddf6b4f3;p=uccvend-vendserver.git Groovy colours :) --- diff --git a/virtualvend/vvend.py b/virtualvend/vvend.py index bb38c58..e395589 100644 --- a/virtualvend/vvend.py +++ b/virtualvend/vvend.py @@ -56,12 +56,26 @@ class appgui: "on_button9_clicked" : self.keypad_clicked, "on_button10_clicked" : self.keypad_clicked, "on_button11_clicked" : self.keypad_clicked, + "on_button11_clicked" : self.keypad_clicked, + "on_door_toggled" : self.door_changed, "on_vvend_destroy_event" : self.quit, "on_vvend_delete_event" : self.quit } self.wTree.signal_autoconnect (dic) display = self.wTree.get_widget("label1") label_font = pango.FontDescription('monospace 28') display.modify_font(label_font) + + label_style = display.get_style().copy() + fg_color = display.get_colormap().alloc_color('lightgreen') + label_style.fg[gtk.STATE_NORMAL] = fg_color + display.set_style(label_style) + + w = self.wTree.get_widget("eventbox1") + wstyle = w.get_style().copy() + bg_color = w.get_colormap().alloc_color('black') + wstyle.bg[gtk.STATE_NORMAL] = bg_color + w.set_style(wstyle) + display.set_text("*5N4CK0RZ*") # vending machine password set here @@ -102,6 +116,10 @@ class appgui: key = '0'+key self.do_send('2'+key+' keypress\n') + def door_changed(self, widget): + print 'Door changed to', widget.pressed() + pass + def handleNewConnection(self,source,condition): #source is a socket in GTK v 1 and a fd in version 2 conn, addr = source.accept()