def aligngrouptags(groups):
# Adjust the y position of the tags in /groups/ so that they all
# have the height of the highest tag.
maxTagHeight = 0
for group in groups:
if group._tag is None:
height = (string.atoi(str(group._ring.cget('borderwidth'))) +
string.atoi(str(group._ring.cget('highlightthickness'))))
else:
height = group._tag.winfo_reqheight()
if maxTagHeight < height:
maxTagHeight = height
for group in groups:
ringBorder = (string.atoi(str(group._ring.cget('borderwidth'))) +
string.atoi(str(group._ring.cget('highlightthickness'))))
topBorder = maxTagHeight / 2 - ringBorder / 2
group._hull.grid_rowconfigure(0, minsize = topBorder)
group._ring.grid_rowconfigure(0,
minsize = maxTagHeight - topBorder - ringBorder)
if group._tag is not None:
group._tag.place(y = maxTagHeight / 2)
评论列表
文章目录