Google Groups Home
Help | Sign in
Message from discussion wxpython dialog - do something after ShowModal()?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Iain King  
View profile
 More options May 15, 4:19 am
Newsgroups: comp.lang.python
From: Iain King <iaink...@gmail.com>
Date: Thu, 15 May 2008 01:19:45 -0700 (PDT)
Local: Thurs, May 15 2008 4:19 am
Subject: Re: wxpython dialog - do something after ShowModal()?
On May 14, 9:37 pm, "David C. Ullrich" <dullr...@sprynet.com> wrote:

> In article
> <a14c2400-e88b-4d90-80bb-a5fe27fed...@m44g2000hsc.googlegroups.com>,
>  Iain King <iaink...@gmail.com> 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.

That's actually what happens - the dialog throws EVT_INIT_DIALOG
before it displays itself.  Not that I really agree with you.  I don't
think that a "do such-and-such dialog" appearing with a "Select file
for such-and-such" file selector on top of it, the file selector being
in focus, is confusing for the user.  Actually, I think it'd be
friendlier - the user can see where the data from the file is going,
so has an immediate reminder of what the (generic) file selector is
for.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google