开发者

How to put arbitrary widgets into a gtk.Menu?

How can any gtk.Widget (eg. a prog开发者_如何学Cress bar) be put into a gtk.Menu as one of the menu items?


Quoting from the PyGTK documentation:

The gtk.MenuItem and its derived widget subclasses are the only valid children of menus.

So the answer is: You can't. But:

As a gtk.MenuItem is a subclass of gtk.Bin it can hold any valid child widget.

If you create a MenuItem without a label:

item = gtk.MenuItem()

you can add most gtk.Widget subclasses as a child to item.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜