1. 布局与其他组件通用方法
grid()
参数:- row
- column
- columnspan
- padx
- pady
- sticky
pack()
参数:- pady
winfo_children()
:返回所有子组件destroy()
2. Frame
ttk.Frame(tk_object)
方法:
grid_columnconfigure(0, weight=1)
grid_rowconfigure(5, weight=1)
3. LabelFrame
ttk.LabelFrame(tk_object, text)
4. Label
ttk.Label(frame, text, font=("微软雅黑", 14, "bold"), wraplength, foreground, relief)
5. 下拉列表Combobox
ttk.Combobox(frame, width, state="readonly")
方法:
- 绑定选择后触发函数:
bind("<<ComboboxSelected>>", function)
current(0)
6. 按钮
ttk.Button(frame, text="开始处理", command=function, width=15)
7. 输入框Entry
ttk.Entry(frame, width=60)
方法:
delete(0, tk.END)
:清楚指定索引范围内的输入内容insert(0, text)
:插入文本到指定索引后