class gui:
def __init__(self):
self.root=t.Tk()
self.root.title('小说阅读器V1.0') #窗口名称
self.root.geometry("700x700") #设置窗口大小
self.root.wm_attributes('-topmost',1) #窗口置顶
self.root.wm_minsize(140, 170) # 设置窗口最小化大小
self.root.wm_maxsize(1440, 2800) # 设置窗口最大化大小
self.root.resizable(width=False, height=True) # 设置窗口宽度不可变,高度可变
self.te=t.Text(self.root,width=60,height=40) #多行文本框
self.b1= t.Button(self.root, text='打开文件',font =("宋体",10,'bold'),command=self.open_file)
self.cb=ttk.Combobox(self.root, width=12) #下拉列表框
self.b2=t.Button(self.root,text='清空内容',command=self.clean) #按钮
self.l1=t.Label(self.root,text='请选择阅读速度:') #标签
self.cb['values'] = ('请选择-----','全部读取','一秒一行','两秒一行','自定义') #设置下拉列表框的内容
self.cb.current(0) #将当前选择状态置为0,也就是第一项
self.cb.bind("<>",self.go) #绑定go函数,然后触发事件
self.b1.place(x=30,y=30)
self.b2.place(x=360,y=26)
self.l1.place(x=130,y=30)
self.te.place(x=30,y=60)
self.cb.place(x=230,y=30)
self.root.mainloop()