0
我不知道爲什麼,但按鈕沒有顯示 - 可能是一些簡單的錯誤,但我沒有看到它。請幫助在tkinter按鈕不顯示
我使用Python 3,如果有幫助
from tkinter import Tk, Label, Button, Entry, IntVar, END, W, E, filedialog, BOTH, Frame, LEFT
class Resizer(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.master = master
master.title("Resizer")
def askdir():
self.dir_opt = options = {}
options['initialdir'] = '~/'
options['mustexist'] = False
options['parent'] = root
options['title'] = 'This is a title'
filedialog.askdirectory(**self.dir_opt)
Button(self, text='askopenfile', command=askdir).pack()
root = Tk()
my_gui = Resizer(root)
root.mainloop()