1
votes

I'm using the latest version of wxPython and Python in Mac OSX Lion and haven't had any problems in using any of the wxPython widgets apart from wx.TextCtrl. Every time this control is initialized, the following error occurs and the text control fails to render.

2011-11-11 16:58:57.255 Python[15021:1107]

CFURLCreateWithString was passed this invalid
URLstring:'/System/Library/CoreServices/CommonCocoaPanels.bundle' 
(a file system path  instead of an URL string). The URL created will 
not work with most file URL functions. CFURLCreateWithFileSystemPath or
CFURLCreateWithFileSystemPathRelativeToBase should be used instead.

Any ideas as to what could be causing the problem?

EDIT: I've included the code which generates the problem, I have attempted to isolate the problem to just initialising the TextCtrl and the same issue occurs.

class TextDialog(wx.Dialog):
   def __init__(self, parent, id, title):

    wx.Dialog.__init__(self, parent, id, title, size=(200,100))

    sizer = self.CreateTextSizer('Enter text')
    pnl1 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
    sizer.Add(pnl1)
    sizer.Add(wx.TextCtrl(pnl1, -1, "", pos=(10,10)))
    self.SetSizer(sizer)

I should add that the common predefined dialog wx.TextEntryDialog also causes this problem.

Thanks for your help so far.

1
I don't know why this happens, but I see it too. - Frank Niessink
Just a long shot... Have you installed Python or did you go with what was preinstalled on your Mac? - Fenikso
Upgraded to 2.7 about 2 weeks ago - but hadn't used wxPython before 2.7 so not sure if it's a version specific problem or not. - bernien2s

1 Answers

2
votes

Upgrading to wxPython 2.9.2.4 Cocoa for Python 2.7, which is the latest unstable build seems to have alleviated the problem for me. Probably not the wisest solution.