Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python ttk按钮子组件_Python_User Interface_Ttk - Fatal编程技术网

python ttk按钮子组件

python ttk按钮子组件,python,user-interface,ttk,Python,User Interface,Ttk,如何访问python ttk按钮子组件? 对于LabelFrame,您可以应用 frameStyle = Style() frameStyle.configure('BW.TLabelframe', background="#272626", foreground="#272626", font=('Arial', 9), relief='flat', bd=1, bg="#272626") labelStyle = Style() labelStyle.configure('BW.TLabe

如何访问python ttk按钮子组件?
对于
LabelFrame
,您可以应用

frameStyle = Style()
frameStyle.configure('BW.TLabelframe', background="#272626", foreground="#272626", font=('Arial', 9), relief='flat', bd=1, bg="#272626")

labelStyle = Style()
labelStyle.configure('BW.TLabelframe.Label', background="#272626", foreground="#fff", font=('Arial', 9))
他们为什么不做一个按钮呢?我尝试了以下方法:

btnStyle = Style()
btnStyle.configure('BW.TButton.border', background="#fff", foreground="#fff", font=('Arial', 9), relief='flat', bd=1, bg="#272626")

另外,
'BW.TButton.border'
'BW.TButton.focus'
'BW.TButton.spating'
都不起作用,不管他们怎么说它应该起作用。

我想出了以下方法来给
按钮一个边框。我必须把它换成tkinter,否则就不行了

self.btnFrame = Frame(self.lblfAudio, bd=1)
self.btnRefresh = Button(self.btnFrame, text="refresh")
self.btnRefresh.configure(bg="#272626", fg="#fff", font=("Arial", 9), bd=0, relief="flat", highlightcolor="#272626", highlightthickness=2)
self.btnRefresh.grid(row=0, column=0, pady=0, padx=0, sticky=N+W)
self.btnRefresh.configure(width=16)
self.btnFrame.grid(row=1, column=1, sticky=N, pady=(5, 10), padx=(0, 10))