david4dev
david4dev

Reputation: 4914

How to put arbitrary widgets into a gtk.Menu?

How can any gtk.Widget (eg. a progress bar) be put into a gtk.Menu as one of the menu items?

Upvotes: 6

Views: 523

Answers (1)

Sven Marnach
Sven Marnach

Reputation: 602735

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.

Upvotes: 7

Related Questions