dialog questions

here is your problem... when binding events you need methods NOT methods calls, also those methods need to comply to a certain interface.

the best way to do this is to implement an UserAndPasswordDialog and have a method like OnCancel handle the exit.

···

On Tue, 15 Mar 2005 01:50:15 +0200, Scott Frankel <leknarf@pacbell.net> wrote:

I seem to be doing a lot of legwork, setting up a dialog and I wonder
if there's an easier way ...

My app presents a wx.Dialog object to set username and password.
I call ShowModal() to make it modal. Is there a flag that sets Cancel
and OK buttons, and traps their events? I'm currently creating them
by hand and adding them to sizers, &c.

To trap their events, I'm trying to use wx.ID_Cancel and
wx.Dialog::EndModal(), but they're throwing an assertion error.
Prior to my wx.EVT_BUTTON method, I call SetReturnCode(0),
as per the docs.

Any suggestions?
[..]
    wx.EVT_BUTTON(wx.ID_CANCEL, dlg.EndModal(0))

--
Peter Damoc
Warrior Of The Light
http://www.sigmacore.net/