次の例でキャンバスに異なる線幅が表示される理由を誰かが知っていますか?
from Tkinter import *
bigBoxSize = 150
class cFrame(Frame):
def __init__(self, master, cwidth=450, cheight=450):
Frame.__init__(self, master, relief=RAISED, height=550, width=600, bg = "grey")
self.canvasWidth = cwidth
self.canvasHeight = cheight
self.canvas = Canvas(self, bg="white", width=cwidth, height=cheight, border =0)
self.drawGridLines()
self.canvas.pack(side=TOP, pady=20, padx=20)
def drawGridLines(self, linewidth = 10):
self.canvas.create_line(0, 0, self.canvasWidth, 0, width= linewidth )
self.canvas.create_line(0, 0, 0, self.canvasHeight, width= linewidth )
self.canvas.create_line(0, self.canvasHeight, self.canvasWidth + 2, self.canvasHeight, width= linewidth )
self.canvas.create_line(self.canvasWidth, self.canvasHeight, self.canvasWidth, 1, width= linewidth )
self.canvas.create_line(0, bigBoxSize, self.canvasWidth, bigBoxSize, width= linewidth )
self.canvas.create_line(0, bigBoxSize * 2, self.canvasWidth, bigBoxSize * 2, width= linewidth)
root = Tk()
C = cFrame(root)
C.pack()
root.mainloop()
何が起こっているのかわからないので、本当にイライラします。誰かが私を助けることができれば、それは素晴らしいでしょう。ありがとう!