0

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"

Error:

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

This error repeats 3 times and doesn't give the output. Is there anything wrong in the script? Thankyou for the help.

I fixed the warning by installing pixbuf:

sudo apt-get install gtk2-engines-pixbuf

Now there's a new problem; the frame just flashes and disappears quickly. I can't read any of those redirected messages!

  • Use `app = App (redirect=False)`, and run the app from a shell, then you'll be able to see the error messages. – Aya Jun 08 '13 at 13:48

1 Answers1

0
self.frame.show()

Should be

self.frame.Show ()

A capital 'S'

Yoriz
  • 3,595
  • 2
  • 13
  • 20