コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
from sample_widgets import label1, label2, label3, label4, button1, button2, button3, exit_button
from constants import WIN, HIN, VT, HL, VC, VB, HAS, HC, WEX
from containernode import GFrame_Row, GFrame_Column, HBox, VBox
from tablenode import GTable
from sample_table import SampleTable
from build import build_gui
import tkinter as TK

tb = SampleTable()
con1 = VBox('Box1', [tb])
con2 = GFrame_Row('Row4', [exit_button],
                  height=40,
                  parms=[WIN, HIN, HC, VC, [0, 0, 0], [0, 0]])
con3 = HBox('Box2', [con1, con2])

root = TK.Tk()

g = con3
build_gui(root, g)
exit_button.set_command(root.destroy)

root.mainloop()
コード例 #4
0
con4 = GFrame_Column('Column2', [button1, button2, button3], width=150, parms=[WIN, HIN, HC, VC,[0,0], [5,5,5]])
con4.configure(background='grey')
#con5 = GFrame_Row('Row3', [con3, con4], parms=[WIN, HIN, HL, VC,[0,0,0], [0,0]])
con5 = VBox('Con5',[con3, con4])
con5.configure(background='lightgreen')

con6 = GFrame_Row('Row4',[exit_button], height=40, parms=[WIN, HIN, HC, VC,[0,0,0], [0,0]])
con6.configure(background='green')
con7 = GFrame_Column('Column3',[con5, con6], parms=[WEX, HIN, HL, VC,[0,0,0], [0,0]]) # Expand frames con5 and con6 to fit con7 width
con7.configure(background='pink')
con8 = HBox('Con7', [con5,con6])
con8.configure(background='yellow')

def resize(event):
    print ('Resize')
    print("The new dimensions are:",event.width,"x",event.height)
    print (root.geometry())



root = TK.Tk()
#root.bind("<Configure>", resize)
g = con8
build_gui(root, g)
exit_button.set_command(root.destroy)
button1.configure(text='Resize')
button1.set_command(resize_test)
#tick()
root.mainloop()