为什么这个wxPython脚本给出一个Gtk警告



OS : Ubuntu 12.1, python : 2.7.3, wx : 2.8 gtk2

#!/usr/bin/env python
#-*- coding:utf-8 -*-
import wx
import sys
class Frame (wx.Frame):
    def __init__(self, parent, id, title):
        print "Frame Initialised"
        wx.Frame.__init__(self, parent, id, title)
class App (wx.App):
    def __init__ (self, redirect=True, filename=None):
        print "Application Initialised"
        wx.App.__init__(self, redirect, filename)
    def OnInit (self):
        print "This is Application"
        self.frame = Frame (parent=None, id=-1, title="Startup")
        self.frame.show ()
        self.SetTopWindow (self.frame)
        print >> sys.stderr, "A fake error message"
        return True
    def OnExit (self):
        print "Application Exiting"
if __name__ == '__main__':
    app = App (redirect=True)
    print "Things Before"
    app.MainLoop ()
    print "Things After"

错误:

(python:3805): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap"

此错误重复 3 次,并且不会给出输出。剧本有什么问题吗?谢谢你的帮助。

我通过安装 pixbuf 修复了警告:

sudo apt-get install gtk2-engines-pixbuf

现在有一个新的问题;框架只是闪烁并迅速消失。我无法阅读任何这些重定向的消息!

self.frame.show()

应该是

self.frame.Show ()

大写的"S">

最新更新