def initUI(self): #Heading of number of ranges self.numRlabel = Label(self, text="%s Ranges:" % rng2.getnRanges()) #establish list of potential widgets self.widgetlist = [] #loop through number of ranges creating widgets and creating fake blank variables for i in range(int(rng2.getnRanges())): rng2.writeRangePara("") rng2.writeRangePara("") rng2.writeRangePara("") self.create_widget(i) #Movement buttons self.nextB = Button(self, text="Next", command=self.nextHandler) self.prevB = Button(self, text="Previous", command=self.prevHandler) #Positioning of widgets self.numRlabel.grid(column=0, row=0, columnspan=2, sticky=(W)) self.nextB.grid(column=1, row=len(self.widgetlist)+2, sticky=(S, E), padx=5, pady=5) self.prevB.grid(column=0, row=len(self.widgetlist)+2, sticky = (E)) for child in self.winfo_children(): child.grid_configure(padx=5, pady=5)
def initUI(self): self.numRlabel = Label(self, text="Number of Ranges:") self.numRanges = IntVar() self.numRanges = Entry(self) self.numRanges.insert(0, rng2.getnRanges()) self.nextB = Button(self, text="Next", command=self.nextHandler) self.prevB = Button(self, text="Previous", command=self.test1a) self.numRlabel.grid(column=0, row=0, columnspan=2, sticky=(W)) self.numRanges.grid(column=0, row=1, columnspan=1, sticky=(N, W)) self.nextB.grid(column=1, row=6, sticky=(S, E), padx=5, pady=5) self.prevB.grid(column=0, row=6, sticky = (E)) for child in self.winfo_children(): child.grid_configure(padx=5, pady=5)