From 3029adceb50e829c8f13d4c7b58da99f02078537 Mon Sep 17 00:00:00 2001 From: Comment Date: Wed, 13 Feb 2013 17:14:24 +0000 Subject: button colours --- dome_control.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dome_control.py b/dome_control.py index e1277b4..f2e286d 100755 --- a/dome_control.py +++ b/dome_control.py @@ -10,7 +10,7 @@ from socket import * from pyfirmata import Arduino, util -labels=["guide\nfocus\nin","guide\nfocus\nout","\n4","\n5","\n6","\n7","\nheat","\ndeHum","\nlight","flat\nfield","\n12","\n13"]; +labels=["guide\nfocus\nin","guide\nfocus\nout","\n4","\n5","\n6","\n7","\nheat","camera\n&\nteleskop","\nlight","flat\nfield","\n12","\n13"]; arduino=Arduino("/dev/ttyUSB0") @@ -21,6 +21,11 @@ class arduinobtn(gtk.ToggleButton): self.set_size_request(60,60) self.connect("clicked", self.toggle, "click") self.time=0 + map = self.get_colormap() + color = map.alloc_color("red") + style = self.get_style().copy() + style.bg[gtk.STATE_ACTIVE] = color + self.set_style(style) def toggle(self,widget,data): arduino.digital[self.num].write(self.get_active()) if self.time>0.0 and self.get_active(): -- cgit v1.2.3