def fill_attributeGroup(self, group, attributes):
"""Provide members of an attribute group.
'group' should be one of the keys in my groupLabels, and
'attributes' a list of (name, value) pairs, with each value as
either an Explorer or string.
"""
# XXX: How to indicate detail level of members?
table = self.subtable[group]
if not attributes:
table.hide()
return
table.resize(len(attributes)+1, 2)
# XXX: Do I need to destroy previously attached children?
row = 1 # 0 is title
for name, value in attributes.items():
label = gtk.Label(name)
label.set_name("AttributeName")
label.set_alignment(0, 0)
if type(value) is types.StringType:
widget = gtk.Label(value)
widget.set_alignment(0, 0)
else:
widget = value.newAttributeWidget(self)
table.attach(label, 0, 1, row, row + 1)
table.attach(widget, 1, 2, row, row + 1)
row = row + 1
table.show_all()
评论列表
文章目录