Python – wxPython 中的 Create()函数
在这篇特别的文章中,我们将了解 wx.Frame 类中存在的 Create()函数。创建函数类似于 wx.Frame 类的 Frame() 构造函数。创建函数用于两步框架构造。
Syntax :
Parameters :
Parameter | Input Type | Description |
---|---|---|
parent | wx.Window | Parent window. Should not be None. |
id | wx.WindowID | Control identifier. A value of -1 denotes a default value. |
title | string | Title to the frame. |
pos | wx.Point | Window position. |
size | wx.Window | Window size. |
style | long | Window style. |
name | string | Window name. |
代码示例:
wx.Frame.Create(parent, id=ID_ANY, title="", pos=DefaultPosition,
size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)
输出 :
在单击新框架按钮之前:
单击“新建框架”按钮后: