wxPython wx.TextCtrl Mac OSX Lion上的问题?

时间:2011-11-11 17:06:27

标签: python wxpython osx-lion

我在Mac OSX Lion中使用了最新版本的wxPython和Python,并且在使用除wx.TextCtrl之外的任何wxPython小部件时没有遇到任何问题。每次初始化此控件时,都会发生以下错误,并且文本控件无法呈现。

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.

关于可能导致问题的任何想法?

编辑:我已经包含了产生问题的代码,我试图将问题隔离到只是初始化TextCtrl并且出现同样的问题。

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)

我应该补充说,常见的预定义对话框 wx.TextEntryDialog 也会导致此问题。

感谢您的帮助。

1 个答案:

答案 0 :(得分:2)

升级到wxPython 2.9.2.4 Cocoa for Python 2.7,这是最新的 unstable 版本似乎已经为我解决了这个问题。可能不是最明智的解决方案。

相关问题