1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
import Tix
import Tkinter as Tk
import Tix
root = Tix.Tk()
## root.resizable(width=False, height=False)
## frameMain = Tk.Frame(root)
## frameMain.config(bg="green")
## frameMain.config(width=800, height=640)
## frameMain.pack()
## frameResult = Tix.ScrolledWindow(frameMain)
frameResult = Tix.ScrolledWindow(root)
frameResult.window.config(bg="white")
frameResult.window.config(width=400, height=320)
frameResult.pack()
## frameResult.place(relx=0.5, rely=0.05, anchor="n")
for i in range(50):
font = ("Helvetica", 10)
bd = 0
rs, cs = None, None
if (i == 0):
font = ("Helvetica", 10+2, "bold")
bd = 0
for j in range(11):
txt = "(%i,%i)"%(i,j)
if (i == 0) and (j<3):
## rs = 2
pass
elif (i == 0) and (j==3):
cs = 2
elif (i == 0) and (j==4):
continue
elif (i == 0) and (j==5):
cs = 2
elif (i == 0) and (j==6):
continue
elif (i == 0) and (j==7):
cs = 2
elif (i == 0) and (j==8):
continue
elif (i == 0) and (j==9):
cs = 2
elif (i == 0) and (j==10):
continue
elif (i == 1) and (j<3):
continue
## elif (i == 1):
## txt = "1"
else:
rs, cs = None, None
f = Tk.Frame(frameResult.window)
f.config(bg=f.master.cget("bg"))
if (i>1) and (j%3 == 0):
f.config(bg="red")
b = Tk.Label(f)
b.config(font=font)
b.config(bd=bd)
b.config(bg=b.master.cget("bg"))
b.config(text=txt)
## b.pack(anchor="s")
## b.place(relx=0.5, rely=1, anchor="s")
## b.pack(side="top")
b.pack(side="bottom")
## b.pack(fill="both", expand=True)
f.grid(row=i, column=j, rowspan=rs, columnspan=cs)
root.mainloop() |
Partager