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')
精彩评论