如何去除复选按钮小部件 tkinter 周围的浅灰色? [英] how to remove light grey color around checkbutton widgets tkinter?

查看:40
本文介绍了如何去除复选按钮小部件 tkinter 周围的浅灰色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在尝试在我的应用程序的背景上设置图像时遇到了一个问题,我想在后台发送它并完成所有条目和内容.所有的文字都将包含在图片本身中,所以我在这一点上没有问题.事实是我不能只在图片上设置 CheckButton 因为它是需要的(我们必须选中它/取消选中)所以我想让它没有由高度和宽度引起的阴影/轮廓(检查图片).我想知道是否有办法禁用宽度和高度,甚至将其设置为 0 但这是不可能的.

I recently had a problem when I was trying to set an image on the background of my app, I want to send it in background and have all entries and stuff over. All the text will be incuded in the picture itself so I got no problem on that point. The fact is that I can't just set the CheckButton on the picture because it is needed (we have to check it / uncheck) so I would like to make it with no shadow / outline (Check picture) caused by the height and width. I want to know if there is a way to disable width and height or even set it to 0 but it is impossible.

我尝试将高度/宽度设置为 0 和其他一些属性,但没有任何帮助

I tried to set height / width to 0 and some other attributes but nothing helped me

Checkbutton1 = Checkbutton(scanallnet, variable=check_var, command=toogle_active, bg="lightgray", activebackground="lightgray", width=0, height=0)

最好的办法是一个不可见的背景,但这很难做到(或者如果你有任何其他想法).但我更喜欢将轮廓设置为不可见或不存在.

The best thing would be an invisible background but that's hard to do (or if you have any other idea). But I prefer to set the outline invisible or inexistant.

推荐答案

经过多次尝试和失败后,我决定重新创建一个带有属性 indicatoron=0 的 Checkbutton 来制作一个简单的按钮,在点击.然后我在里面添加了一个带有复选标记✓"的位图,这是结果.

After many tries and fails I decided to recreate a Checkbutton with the property indicatoron=0 to make a simple button that remains pushed when clicked. Then i added a bitmap with a check mark "✓" inside and here's the result.

无论如何感谢您的建议,但这个结果完全符合我想要的.

Thanks for your advices anyway but this result fit perfectly with what I wanted.

这篇关于如何去除复选按钮小部件 tkinter 周围的浅灰色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆