def main(alljobs, stagelist): # print (x) print("-") print(alljobs[0]) stage = stagelist[0] # stage = 'ced' print("-" * 70) weeks = current_delivery(alljobs, stage) # for week in weeks: # print (week['title']) # for job in week['jobs']: # print (job['jobname']) title = GLabel("Title", width=300, height=20, text="Latest CRC Jobs") header = GFrame_Row("Header", [title], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]]) footer = GFrame_Row("Footer", [exit_button], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]]) stagelabel = GLabel("Title", width=100, height=20, text=stage) stagerow = GFrame_Row("StageRow", [stagelabel], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]]) # Create stage selection button cedbutton = GButton("GetCED", width=100, height=30, text="CED") initialbutton = GButton("GetInitial", width=100, height=30, text="Initial") secondpagesbutton = GButton("SecondPages", width=100, height=30, text="Second Pages") finalpagesbutton = GButton("FinalPages", width=100, height=30, text="Final Pages") sbutton = GFrame_Row( "SButtonRow", [cedbutton, initialbutton, secondpagesbutton, finalpagesbutton], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]], ) widgets = [header, sbutton, stagerow] # Create table for i, week in enumerate(weeks): tb = create_stuff(i, week) widgets.append(tb) widgets.append(footer) con3 = HBox("MainBox", widgets) root = TK.Tk() g = con3 build_gui(root, g) status = ["quit"] exit_button.set_command(root.destroy) cedbutton.set_command(lambda: clicked(root, status, "ced")) initialbutton.set_command(lambda: clicked(root, status, "initial")) secondpagesbutton.set_command(lambda: clicked(root, status, "2ndpages")) finalpagesbutton.set_command(lambda: clicked(root, status, "finalpages")) title.widget.configure(foreground="black", font="arial 14 bold", background="white") stagelabel.widget.configure(foreground="black", font="arial 12 bold", background="white") root.mainloop() # Now which button was pressed? return status
def main(alljobs, stagelist): #print (x) print ('-') print (alljobs[0]) stage = stagelist[0] #stage = 'ced' print ('-'*70) weeks = current_delivery(alljobs, stage) #for week in weeks: # print (week['title']) # for job in week['jobs']: # print (job['jobname']) title = GLabel('Title', width=300, height=20, text='Latest CRC Jobs') header = GFrame_Row('Header', [title], height = 40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]]) footer = GFrame_Row('Footer',[exit_button], height=40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]]) stagelabel = GLabel('Title', width=100, height=20, text=stage) stagerow = GFrame_Row('StageRow',[stagelabel], height=40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]]) # Create stage selection button cedbutton = GButton('GetCED', width=100, height=30, text='CED') initialbutton = GButton('GetInitial', width=100, height=30, text='Initial') secondpagesbutton = GButton('SecondPages', width=100, height=30, text='Second Pages') finalpagesbutton = GButton('FinalPages', width=100, height=30, text='Final Pages') sbutton = GFrame_Row('SButtonRow',[cedbutton, initialbutton, secondpagesbutton, finalpagesbutton], height=40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]]) widgets = [header, sbutton, stagerow] # Create table for i, week in enumerate(weeks): tb = create_stuff(i, week) widgets.append(tb) widgets.append(footer) con3 = HBox('MainBox', widgets) root = TK.Tk() g = con3 build_gui(root, g) status = ['quit'] exit_button.set_command(root.destroy) cedbutton.set_command(lambda: clicked(root, status, 'ced') ) initialbutton.set_command(lambda: clicked(root, status, 'initial') ) secondpagesbutton.set_command(lambda: clicked(root, status, '2ndpages') ) finalpagesbutton.set_command(lambda: clicked(root, status, 'finalpages') ) title.widget.configure(foreground="black", font='arial 14 bold', background='white') stagelabel.widget.configure(foreground="black", font='arial 12 bold', background='white') root.mainloop() # Now which button was pressed? return status
def create_stage_window(self, stage): stagelabel = GLabel(stage + "StageTitle", width=100, height=20, text=stage) stagerow = GFrame_Row(stage + "StageRow", [stagelabel], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]]) stagerow.configure(background="black") # Create table widgets = [stagerow] weeks = current_delivery(self.job_recs, stage) for i, week in enumerate(weeks): tb = create_stage_table(i, week) widgets.append(tb) stage_window = HBox(stage + "MainBox", widgets) # Position Topwindow right of buttons x, y = self.ced_button.get_absolute_x_y() x += self.ced_button.width + 10 build_gui(None, stage_window, xpos=x) # stagerow.widget.configure(background='black') return stage_window
def create_stage_window(self, stage): stagelabel = GLabel(stage + 'StageTitle', width=100, height=20, text=stage) stagerow = GFrame_Row(stage + 'StageRow', [stagelabel], height=40, parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]]) stagerow.configure(background='black') # Create table widgets = [stagerow] weeks = current_delivery(self.job_recs, stage) for i, week in enumerate(weeks): tb = create_stage_table(i, week) widgets.append(tb) stage_window = HBox(stage + 'MainBox', widgets) # Position Topwindow right of buttons x, y = self.ced_button.get_absolute_x_y() x += self.ced_button.width + 10 build_gui(None, stage_window, xpos=x) #stagerow.widget.configure(background='black') return stage_window