auto_size属性

auto_size属性

指示注意事项的大小是否根据其内容自动调整。 注意:在某些特殊情况下(例如 Mac 环境),此设置可能不会生效。如果此设置不生效,请将其替换为 FitToTextSize()。

例子


if notcomment1.auto_size:
    # The size of the comment varies with the content
    comment1.auto_size = True

定义:

@property
def auto_size(self):
    ...
@auto_size.setter
def auto_size(self, value):
    ...

也可以看看