http://www.perlmonks.org?node_id=290577


in reply to Re: Re: WxPerl Login Dialog
in thread WxPerl Login Dialog

If ShowModal returns true, the app hangs...
That's because you've turned control over to wxWindows, but there is nothing telling the app to die (basically, you need to $app->SetTopWindow($dialog) if you want the application to exit when the window is destroyed).

but I still think returning false from OnInit should be perfectly valid.
I'd say I agree with you (even though I've never had the need/urge to do that), but I suspect there might be a real good reason for this (a carp would be fine with me -- you should definetly inquire on the list).

update: I almost forgot, it's called wxPerl, not WxPerl ;)

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: Re: Re: WxPerl Login Dialog
by Jouke (Curate) on Sep 11, 2003 at 05:52 UTC
    There is a perfectly good situation when you want OnInit to return false imho. I use it myself in pVoice, where I use the SingleInstanceChecker. If there is already another copy of pVoice running, I let OnInit return false, so the application dies.

    Jouke Visser, Perl 'Adept'
    Using Perl to help the disabled: pVoice and pStory