Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

day_form.py

By: a guest on Jun 29th, 2013  |  syntax: Python  |  size: 1.31 KB  |  hits: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # This is a tkinter form to collect day data
  2. from Tkinter import *
  3. from day_data import *
  4.  
  5. def messageWindow(parent, day):
  6.     # create child window
  7.     win = Toplevel()
  8.     win.title("TODO For " + day.fname)
  9.     num_lines = day.get_num_chores()
  10.     print str(num_lines) + " have been passed into this function from the day"
  11.     main_frame = Frame(win, width = 320, height = 240)
  12.     #canvas=Canvas(main_frame, width = 320, height = 240)
  13.     #scroll_bar = Scrollbar(main_frame, orient = VERTICAL)
  14.     #scroll_bar.pack(side = RIGHT, fill = Y)
  15.     #scroll_bar.config(command=canvas.yview)
  16.     #canvas.config(width = 300, height = 240)
  17.     #canvas.config(yscrollcommand=scroll_bar.set)
  18.  
  19.     for i in range(num_lines):
  20.         f = Frame(main_frame)
  21.         b =  Checkbutton(f)
  22.         if(day.get_index(i)[0] == True):
  23.             b.select()
  24.         b.pack(side = LEFT)
  25.         e = Text(f, width = 40, height = 3)
  26.         e.insert("1.0", day.get_index(i)[1])
  27.         e.pack(side = LEFT)
  28.         Button(f, text = "Delete").pack(side = LEFT)
  29.         f.pack()
  30.  
  31.     main_frame.pack()
  32.    
  33.     #canvas.config(scrollregion = (0,0, 320,200))
  34.     #canvas.pack(side = LEFT, expand = TRUE, fill = BOTH)
  35.    
  36.  
  37.     x = parent.winfo_x() + 32
  38.     y = parent.winfo_y() + 32
  39.  
  40.     win.geometry("+%d+%d" % (x, y))