gtk menu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
self.menu = gtk.Menu()
for i in ((gtk.STOCK_COPY, "Copy", self.m_copy),
(gtk.STOCK_CLEAR, "Clear", self.m_clear),
(gtk.STOCK_CLEAR, "Clear All", self.m_clear_all)):
menu_items = gtk.ImageMenuItem(i[1])
img = gtk.image_new_from_stock(i[0], gtk.ICON_SIZE_MENU)
menu_items.set_image(img)
self.menu.append(menu_items)
menu_items.connect("activate", i[2])
menu_items.show()