开发者

gtk+ checkbutton settings

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜