wxPython wx.TextCtrl Mac OSX Lion 上有问题吗?

发布于 2024-12-15 07:27:30 字数 1087 浏览 3 评论 0原文

我在 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 也会导致此问题。

感谢您迄今为止的帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪化雨蝶 2024-12-22 07:27:30

升级到 wxPython 2.9.2.4 Cocoa for Python 2.7(最新的不稳定版本)似乎缓解了我的问题。可能不是最明智的解决方案。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文