In article <[EMAIL PROTECTED]>, Iain King <[EMAIL PROTECTED]> wrote:
> Hi. I have a modal dialog whcih has a "Browse..." button which pops > up a file selector. This all works fine, but the first thing the user > has to do when they open the dialog is select a file, so I would like > the dialog to automatically call the onBrowse function as soon as the > dialog opens. However, I don't know how to do this. > > dlg.ShowModal() > onBrowse() > > obviously doesn't work, and neither does the reverse. I was hoping > that the dialog would throw some kind of "I have been shown" event, > but it doesn't (as far as I can tell). How do I make the dialog do > something as soon as it's been shown? It's too bad that you found an answer. You _shouldn't_ have your dialog pop up a file-selection box as soon as it's shown! That's not the way dialogs usually work, so you're going to confuse people. Instead, first pop up the file-selection box, and then pop up the dialog (without the Browse button) to do whatever else it does after you've got the filename. > Iain -- http://mail.python.org/mailman/listinfo/python-list