[wxPython] question

There's your problem. self.ShowModal causes the dialog to be processed and
displayed. Because it is modal, the thread will stop executing at that point
until the window is killed via EndModal. But at the time you run ShowModal,
you have not yet registered the button handlers.

Move the ShowModal() call after the EVT_BUTTON calls, and you should be much
happier.

···

On Sun, 21 Jul 2002 15:18:19 -0700, "Chris Cesare" <chrisc894@hotmail.com> wrote:

My friend and I have been working on a GUI for a game I wrote. So far
it's very bare-bones, but we are having difficulties.
...
I'm in step 3 or so in that process. Right now, I can bring the first
Modal up with the buttons on it, but for reasons beyond me, I cannot get
the buttons to do anything. Right now I'm just trying to get the to
close the Dialog with EndModal(SOMEID), and then try to work from there.

OK, on to the code:
...

class jitsuPromptDlg(wxDialog):
   def __init__(self, parent, id, title):
       wxDialog.__init__(self, parent, -1, title, wxDefaultPosition,
                        wxSize(300, 200))
       server = wxButton(self, -1, 'Server', wxPoint(90, 75),
                         wxSize(50, 30))
       client = wxButton(self, -1, 'Client', wxPoint(140, 75),
                         wxSize(50, 30))

       self.ShowModal()

       EVT_BUTTON(self, server.GetId(), self.OnServer)
       EVT_BUTTON(self, client.GetId(), self.OnClient)

--
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc.