Groovy colours :)
authorBernard Blackham <[email protected]>
Sun, 27 Jun 2004 19:35:27 +0000 (19:35 +0000)
committerBernard Blackham <[email protected]>
Sun, 27 Jun 2004 19:35:27 +0000 (19:35 +0000)
virtualvend/vvend.py

index bb38c58..e395589 100644 (file)
@@ -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()

UCC git Repository :: git.ucc.asn.au