wxPython | wx.ToolBar 中的 InsertLabelTool()函数
在本文中,我们将学习与 wxPython 中的 wx.ToolBar 类关联的 InsertLabelTool()函数。 InsertLabelTool() 是一种在工具栏中插入工具的旧式方法。 InsertLabelTool() 将工具的不同属性作为插入工具的参数。
Syntax :
Parameters :
Parameter | Input Type | Description |
---|---|---|
pos | int | position on which tool is to be added starting from 0. |
id | 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. |
Return Type:
wx.ToolBarToolBase
代码示例 1:
wx.ToolBar.InsertLabelTool(self, pos, id, label, bitmap, bmpDisabled=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortHelp="", longHelp="", clientData=None)
输出:
在单击配置文件工具之前:
单击配置文件工具后: