def GetMinSize(self):
dc = wx.ClientDC(self.Parent)
min_width = 0
min_height = 0
# The comment minimum size is the maximum size of words in the content
for line in self.Content.splitlines():
for word in line.split(" "):
wordwidth, wordheight = dc.GetTextExtent(word)
min_width = max(min_width, wordwidth)
min_height = max(min_height, wordheight)
return min_width + 20, min_height + 20
# Changes the comment position
评论列表
文章目录