def _create_legend(self):
icons = (
(gtk.STOCK_FILE, 'Class'),
(gtk.STOCK_EXECUTE, 'Method'),
(gtk.STOCK_SELECT_FONT, 'Field'),
(gtk.STOCK_DELETE, 'Declaration not found'),
(gtk.STOCK_INFO, 'Miscellaneous (info)'),
(u'?', 'Direct call – e.g. static, private, etc'),
(u'?', 'Virtual call (? + ?)'),
(u'?', 'Virtual call (indirect) which could be performed because '
'of polymorphism'),
(u'?', 'Virtual call (direct only) which does not actually '
'performed – e.g. interface method'),
(u'?', 'Super call (? + ?)'),
(u'?', 'Super call (indirect) because direct super does not '
'declare the method'),
(u'?', 'Super call (direct only) which does not actually '
'performed – e.g. not declared here'),
)
table = gtk.Table(7, 5)
table.set_border_width(8)
table.set_row_spacings(8)
table.set_col_spacings(8)
separator = gtk.VSeparator()
table.attach(separator, 2, 3, 0, 7, 0)
x, y = 0, 0
for icon, desc in icons:
if len(icon) == 1:
image = gtk.Label(icon)
else:
image = gtk.Image()
image.set_from_stock(icon, gtk.ICON_SIZE_MENU)
image.set_alignment(1, 0.5)
label = gtk.Label(desc)
label.set_alignment(0, 0.5)
table.attach(image, x + 0, x + 1, y, y + 1, gtk.FILL)
table.attach(label, x + 1, x + 2, y, y + 1, gtk.FILL)
y += 1
if y == 5 and x == 0:
x, y = 3, 0
frame = gtk.Frame('Legend')
frame.add(table)
return frame
评论列表
文章目录