def changecolor(self, widgidx, bool): #simply changes bg color of widg, depending on bool if widgidx != None: #this guarantees no coloring of unused devices; basically same loop in changeconnections widg=self.l5[widgidx] #get real widget object from list if widgidx>=6: #formerly it was if (str(widg)[12])=='2', however tkinter objects don't seem to be named to the same convention as on this deb machine if bool is True: widg.config(bg='green') else: widg.config(bg='red') self.master.update() #works much better with update(), dont know why else: relais(widgidx,bool) if bool is True: widg.config(bg='blue') else: widg.config(bg='grey') self.master.update()
def relay(self, widgidx, bool): #simply changes bg color of widg, depending on bool if widgidx != None: #this guarantees no coloring of unused devices; basically same loop in changeconnections relais(widgidx, bool)