import tkinter as tk
from tkinter import ttk
def cbBegin(self):
pass
def sel_result():
python functiontools。pass
def get_result():
pass
def get_data(filename):
pass
mb_col = ['A','B','C','D','E','F','G','H','I','J','K']
python tkinter 滾動條、xx_col = ['A','B','C','D','E']
root = tk.Tk()? ?? ?? ???# 創建一個窗口
root.title('AAAA')? ? # 窗口標題
root.geometry("430x300+370+150")
srb = ttk.Scrollbar(root)
frm = tk.Text(root, height='8', width='20')
python tkinter button。global listC
listC = []
tk.Label(root, text='AAAAAAAA', height=1, width=20,??\
padx=0,pady=10,background='green', foreground='white').grid(row=0,column=0)
tk.Label(root, text='DDDDDDDD', height=1, width=20,??\
padx=0,pady=10,background='green', foreground='white').grid(row=0,column=1)
tkinter選項卡。for i, m in enumerate(mb_col):
lab = ttk.Label(frm, text=m, width=20)
frm.window_create(tk.INSERT,window=lab)
lab.grid(row=i + 1,column=0, padx=5, pady=5, columnspan=2)
cv = tk.StringVar()
cmb = ttk.Combobox(frm, values= xx_col, textvariable=cv, width=30)
python圖形界面、frm.window_create(tk.INSERT,window=cmb)
listC.append(cmb)
cmb.grid(row=i + 1, column=4, padx=5, pady=5, columnspan=3)
cmb.bind('', cbBegin)? ?? ? # 得到焦點時執行
srb.config(command=frm.yview)
frm.config(yscrollcommand=srb.set)
python中tkinter、srb.grid(row=1, column=2, rowspan=i, sticky=tk.S + tk.N)
frm.grid(row=1,column=0,columnspan=2, sticky=tk.S + tk.N)
tk.Button(root, text="確定", command=get_result, height=1, width=7, \
padx=10, pady=1, bg='orange').grid(row=i+1,column=0,padx=5, pady=5)
tk.Button(root, text="退出", command=root.quit, height=1, width=7, \
padx=10, pady=1, bg='orange').grid(row=i+1,column=1, padx=5, pady=5)
python tkinter詳解、root.mainloop()
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态