Пример #1
0
def drawAllTasks():
    numTasks = db.getNumTasks()
    root.taskRow = range(numTasks)
    curs = db.getAllTasks()
    r = 0
    for row in curs:
        root.taskRow[r] = TaskRow.TaskRow()
        root.taskRow[r].setFrame(bodyFrame)
        root.taskRow[r].setTitle(row[1])
        root.taskRow[r].setDesc(row[2])
        root.taskRow[r].createRow()
        r = r+1

    canvas.pack()
Пример #2
0
taskEntry = Entry(newTask)
taskEntry.config(bg="#ffffff", relief=FLAT)
taskEntry.pack(side=LEFT, fill=BOTH, expand=1)
taskEntry.insert(0,"Add New Task")

taskButton = Button(newTask)
taskButton.config(text=">>>", relief=FLAT, command=createTask)
taskButton.pack(side=RIGHT, fill=X, expand=0)

newTaskBorder = Frame(bodyFrame)
newTaskBorder.config(height=2, bg="#cbcbcb")
newTaskBorder.pack(side=TOP, fill=X, expand=1)


numTasks = db.getNumTasks()

if numTasks > 0:
    root.taskRow = range(numTasks)
    data = db.getAllTasks()
    r = 0
    for row in data:
        root.taskRow[r] = TaskRow.TaskRow()
        root.taskRow[r].setFrame(bodyFrame)
        root.taskRow[r].setTitle(row[1])
        root.taskRow[r].setDesc(row[2])
        root.taskRow[r].createRow()
        
        r = r+1
else:
    emptyTasks = Frame(bodyFrame)