Using wxPython in COM server

Robin Becker robin at jessikat.demon.co.uk
Fri Dec 3 10:25:24 EST 1999


In article <d0E14.1$002.65844 at news.randori.com>, Robin Dunn
<robin at alldunn.com> writes
...
>At a minimum, you might try something like this:
>
>   def RequestYesNo(self):
>      from wxPython.wx import *
>      class MyApp(wxApp):
>          def OnInit(self):
>              return true
>      app = MyApp(0)
>
>      win = wxDialog(NULL, -1, "HELLO", wxDefaultPosition, wxSize(350,200))
>      wxStaticText(win, -1, "This is a wxDialog", wxPoint(20, 20))
>      wxButton(win, wxID_OK,     " OK ", wxPoint(75,
>120),wxDefaultSize).SetDefault()
>      wxButton(win, wxID_CANCEL, " Cancel ", wxPoint(200, 120),wxDefaultSize)
>      val = win.ShowModal()
>      win.Destroy()
>      return val
>
>
>Although I am not sure what you might lose by not getting into the
>app.MainLoop...
>
...

I tried this snippet and it works the first time, but complains about
only being allowed one app per process. How do I shut down wxPython
cleanly and later restart it?
-- 
Robin Becker




More information about the Python-list mailing list