def setPixelList(self): if "pixelListBox" in self.widgetDict.keys(): pixelListBox = self.widgetDict["pixelListBox"] pixelListBox.delete(0, "end") self.widgetDict["kernelListbox"].config(text="Pixels: %s" % len( self.RepLine.getKernel(self.activeCob, self.activeKernel).keys())) else: pixelListbox = Listbox(self) self.widgetDict["pixelListbox"] = pixelListbox scrollbar = Scrollbar(pixelListbox, orient="vertical") pixelListbox.config(yscrollcommand=scrollbar.set) scrollbar.config(command=pixelListbox.yview) self.widgetDict["pixelsLabel"].config(text="Pixels: %s" % len( self.RepLine.getKernel(self.activeCob, self.activeKernel).keys())) pixelListbox.grid(row=3, column=2, rowspan=3, sticky="nsew") pixelListbox.columnconfigure(0, weight=1) pixelListbox.bind("<<ListboxSelect>>", self.updateActivePixel) scrollbar.grid(column=2, sticky="e") cobNumber = self.activeCob[:self.activeCob.index("_")] kernelNumber = self.activeKernel[self.activeKernel.index(" ") + 1:] kernel = self.RepLine.getKernel(int(cobNumber), int(kernelNumber)) for pixelNumber in xrange(len(kernel.keys())): pixelListbox.insert(pixelNumber, "Pixel: %s" % pixelNumber)
def setKernelList(self): self.kernelList = [] for i in xrange(len(self.RepLine.cobs[self.activeCob])): self.kernelList.append("Kernel: " + str(i + 1)) if "kernelListbox" in self.widgetDict.keys(): kernelListbox = self.widgetDict["kernelListbox"] kernelListbox.delete(0, "end") self.widgetDict["kernelsLabel"].config(text="Kernels: %s" % len(self.kernelList)) else: kernelListbox = Listbox(self) self.widgetDict["kernelListbox"] = kernelListbox scrollbar = Scrollbar(kernelListbox, orient="vertical") kernelListbox.config(yscrollcommand=scrollbar.set) scrollbar.config(command=kernelListbox.yview) self.widgetDict["kernelsLabel"].config(text="Kernels: %s" % len(self.kernelList)) kernelListbox.grid(row=3, column=1, rowspan=3, sticky="nsew") kernelListbox.columnconfigure(0, weight=1) kernelListbox.bind("<<ListboxSelect>>", self.updateActiveKernel) scrollbar.grid(column=1, sticky="e") for kernel in self.kernelList: kernelListbox.insert(self.kernelList.index(kernel), kernel)
def setCobList(self): self.cobList = [] for cob in xrange(len(self.RepLine.cobs.keys())): self.cobList.append( str(cob + 1) + "_" + self.RepLine.accessionName) if "cobListbox" in self.widgetDict.keys(): cobListbox = self.widgetDict["cobListbox"] cobListbox.delete(0, "end") self.widgetDict["cobsLabel"].config(text="Cobs: %s" % len(self.cobList)) else: cobListbox = Listbox(self) self.widgetDict["cobListbox"] = cobListbox scrollbar = Scrollbar(cobListbox, orient="vertical") cobListbox.config(yscrollcommand=scrollbar.set) scrollbar.config(command=cobListbox.yview) self.widgetDict["cobsLabel"].config(text="Cobs: %s" % len(self.cobList)) cobListbox.grid(row=3, column=0, rowspan=3, sticky="nsew") cobListbox.columnconfigure(0, weight=1) cobListbox.bind("<<ListboxSelect>>", self.updateActiveCob) scrollbar.grid(column=0, sticky="e") for cob in self.cobList: cobListbox.insert(self.cobList.index(cob), cob)