def body(self, master):
tree = ttk.Treeview(master, columns=['Owner', 'Description'])
tree.heading('#0', text='Name', anchor=tk.W)
tree.heading('Owner', text='Owner', anchor=tk.W)
tree.heading('Description', text='Description', anchor=tk.W)
tree.column('#0', width=140)
tree.column('Owner', width=70)
tree.column('Description', width=220)
# Store a list of photos. This is just to get around a tk bug.
# If the photo memory doesn't exist for the duration the photo isn't
# displayed
self.photoList = []
tree.grid(row=0)
for entry in self.objList:
if entry:
print(entry)
self.photo = tk.PhotoImage(file="resource/images/" + entry['image'])
self.photo = self.photo.subsample(int(self.photo.width()/20))
self.photoList.append(self.photo)
if entry['type'] == 'ship':
self.shipInfo(tree, entry)
elif entry['type'] == 'base':
self.baseInfo(tree, entry)
elif entry['type'] == 'star':
self.starInfo(tree, entry)
else:
self.otherInfo(tree, entry)
return tree # initial focus
# PURPOSE:
# RETURNS:
评论列表
文章目录