首页 > 解决方案 > 如何在 tkinter GUI 上使按钮变平

问题描述

你好美丽的社区。我正在研究覆盆子上的 tkinter GUI。好吧,首先我开始在 Windows 上编写我的 gui,我想让我的按钮在屏幕上看起来很平,边缘没有任何线条,并且使用浮雕 ='flat'效果很好,但是当我完成我的项目并在我的树莓上运行我的程序时我的按钮在边缘有那些线条,看起来relief='flat' 没有任何效果,我尝试使用relief=FLAT,但仍然存在同样的问题

在这里您可以看到正在运行的程序的屏幕截图和我的按钮周围的线条

我的覆盆子屏幕截图

这是我的代码

bouton_break = Button(f2, image=img_break, relief='flat' , command = break_ )  #break
bouton_break.place(bordermode=OUTSIDE, height=134, width=107, x=40 , y=200)
bouton_MM = Button(f2, image=img_MM, relief='flat', command=maint_page)
bouton_MM.place(bordermode=OUTSIDE, height=134, width=107, x=170 , y=200)
boutonlogout = Button(f2, image=img_logout , relief='flat', command = logout_cmd)  #logout
boutonlogout.place(bordermode=OUTSIDE, height=134, width=107, x=300 , y=200)

标签: pythontkinterraspberry-pi3raspbian

解决方案


设置按钮边框 = 0。

bd=0

(满足 SO 的额外字符)


推荐阅读