Search code examples
pythonwxwidgetsinterpreter

wxGTK can not Runnable


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))

this code has not specific error. but execute this file and python interpreter says

getattr(CT, "TR_ALIGN_WINDOWS", CT.TR_ALIGN_WINDOWS))
<type 'exceptions.TypeError'>: __init__() got an unexpected keyword argument 'agwStyle'

what is problem in this code. I'm in totally in panic.


Solution

  • Cause by wxGTK version is too low. (2.8.10 -> 2.8.12 )

    Update wxGTK version and upper code is works fine.