wxPython – wx.ToolBar 中的 AddSimpleTool()函数
在本文中,我们将学习 wxPython 的 wx.ToolBar 类中的另一个方法,即 AddSimpleTool() 方法。 AddSimpleTool() 是向工具栏添加工具的旧式方法。
Syntax:
Parameters :
Parameter | Input Type | Description |
---|---|---|
toolid | int | An integer by which the tool may be identified in subsequent operations. |
label | string | The string to be displayed with the tool. |
bitmap | wx.bitmap | The primary tool bitmap. |
bmpDisabled | wx.bitmap | The bitmap used when the tool is disabled. |
kind | int | kind of toolbar. |
shortHelp | string | This string is used for the tools tooltip. |
longHelp | string | detailed string associated with tool. |
clientData | PyUserData | An optional pointer to client data which can be retrieved later using GetToolClientData. |
代码示例:
wx.ToolBar.AddLabelTool(self, id, bitmap, shortHelpString="", isToggle=0)
输出 :