开发者

How to change the label of a MenuItem in a PyGTK application?

I'm writing a small Application Indicator for Ubuntu in Python. I need to change the text of an insensitive (disabled) gtk.MenuItem. I know a livi开发者_StackOverflowng example for this function, the topmost item in the built-in Bluetooth Indicator.


The gtk.MenuItem is a container that usually has the actual label as its child widget, unless there is something more complicated like an image involved; if the child is just a simple label, you should be able to do

menuitem.get_child().set_text('New text')
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜