wxPython – wx.Button中的Create()函数
在这篇文章中,我们将学习与wxPython的wx.Button类相关的Clear()函数。Create()函数用于两步创建按钮的功能。
它将按钮的属性作为参数。
语法:wx.Button.Create(self, parent, id=ID_ANY, label=””, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=ButtonNameStr)
参数。
参数 | 输入类型 | 说明 |
---|---|---|
parent | wx.Window | 父窗口。不应该是无。 |
id | wx.WindowID | 控件标识符。值为-1表示默认值。 |
label | 字符串 | 文本标签。 |
pos | wx.Point | 窗口的位置。 |
size | wx.Window | 窗口的大小。 |
style | 长 | 窗口风格。 |
validator | wx.validator | 窗口验证器。 |
name | 字符串 | 窗口名称。 |
返回类型: bool
代码示例。
输出窗口: