0
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'

这段代码有什么问题。我完全处于恐慌之中。

4

1 回答 1

0

由 wxGTK 版本过低引起。(2.8.10 -> 2.8.12 )

更新 wxGTK 版本和上层代码工作正常。

于 2012-08-07T12:06:34.987 回答