2
我想在進度條的一側繪製刻度線。如何防止Tk增加空間?
例如:
from tkinter import *
from tkinter import ttk
root = Tk()
mainframe = ttk.Frame(root, padding="3 3 12 12")
mainframe.grid(column=0, row=0, sticky=(N, W, E, S))
mainframe.columnconfigure(0, weight=1)
mainframe.rowconfigure(0, weight=1)
TickValue=15
#TickValue=85
ttk.Label(mainframe, text='%2i-' % TickValue).grid(row=1, column=1, sticky=(N,E), pady=(100-TickValue-13))
pbar= ttk.Progressbar(mainframe, value=15, orient=VERTICAL, length=100)
pbar.grid(row=1, column=2, sticky=(N, W))
root.mainloop()
TickValue = 85看起來相當不錯,但TickValue = 15似乎行的高度推到南部。窗戶有一個大而醜陋的邊框。我怎樣才能防止呢?
(我的代碼主要是從http://www.tkdocs.com/tutorial/firstexample.html複製粘貼)