开发者

gtk+ checkbutton settings

开发者 https://www.devze.com 2023-01-02 11:45 出处:网络
Is there a way to use set_active on a gtkCheckButton but without the user being able to press/toggle the said button?

Is there a way to use set_active on a gtkCheckButton but without the user being able to press/toggle the said button?

In other words, I want to programmatically control the active state of the CheckButton but 开发者_Python百科I don't want the user to be able to change it.


The "active" property of the gtk.ToggleButton combined with the "sensitive" property of the gtk.Widget should do what you want. You should just be able to do

checkbox1.set_sensitive(False)
checkbox1.set_active(True)

...to check it and have it remain unchangeable.

0

精彩评论

暂无评论...
验证码 换一张
取 消