[wxpython-users] a few stupid questions ...

Stef Mientki s.mientki at ru.nl
Sun Apr 27 16:21:26 PDT 2008


hello,

I'm trying to write a cross platform simulator for PPyGui,
based on wxPython.

So the basic idea is to replace the PPyGui library with a wxPython library,
but I stumbeld over a few constructs for which I can't find a translation:

--------------
the first one, (literary from a demo script):
  app = gui.Application ( MainFrame () )

It isn't accepted because:
- I can't create a main frame before I've created the application

So as a work around, I changed this in
  app = gui.Application(MainFrame)

and let the gui.Application create the MainFrame
-----------------
the second one:
    gui.Message.ok ( "About", "Ppygui demo", "info", self)

I tried this
class Message ( object ) :
  def __init__ ( self ) :
    pass
  def ok ( self, caption = '', message = '', parent = None ) :
    wx.MessageDialog (  parent, message, caption,
                        style = wx.OK | wx.ICON_INFORMATION )

But that gives the following error:
unbound method ok() must be called with Message instance as first 
argument (got str instance instead)
---------------

thanks,
Stef Mientki



More information about the wxpython-users mailing list