import wx
import wx.lib.buttons
import wx.lib.agw.customtreectrl as CT
from PLCControler import ITEMS_VARIABLE, ITEM_CONFIGURATION, ITEM_RESOURCE, ITEM_POU
from utils.BitmapLibrary import GetBitmap
class PouInstanceVariablesPanel(wx.Panel):
def __init__(self, parent, window, controller, debug):
self.VariablesList = CT.CustomTreeCtrl(self,
style=wx.SUNKEN_BORDER,
agwStyle=CT.TR_NO_BUTTONS|
CT.TR_SINGLE|
CT.TR_HAS_VARIABLE_ROW_HEIGHT|
CT.TR_HIDE_ROOT|
CT.TR_NO_LINES|
getattr(CT, "TR_ALIGN_WINDOWS", CT.TR_ALIGN_WINDOWS))
此代码没有具体错误。但是执行这个文件,python解释器说
getattr(CT, "TR_ALIGN_WINDOWS", CT.TR_ALIGN_WINDOWS))
<type 'exceptions.TypeError'>: __init__() got an unexpected keyword argument 'agwStyle'
这段代码有什么问题。我完全处于恐慌之中。