开发者

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

开发者 https://www.devze.com 2023-02-09 23:31 出处:网络
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

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

精彩评论

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